Commit b3d5f148 authored by Matthias Clasen's avatar Matthias Clasen

More work on #71430.

	* examples/*/Makefile (CFLAGS): add deprecation guards.

	* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
	deprecation-clean; the major offenders right now are the examples
	that make heavy use of completely deprecated or broken widgets:
	list, tree, text, pixmap, paned and progressbar. These will have
	to be redone from scratch.

	* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
parent 554838e4
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
2002-02-17 Matthias Clasen <matthias@YAST_ASK>
More work on #71430.
* examples/*/Makefile (CFLAGS): add deprecation guards.
* docs/tutorial/gtk-tut.sgml, examples/*/*.c: make most examples
deprecation-clean; the major offenders right now are the examples
that make heavy use of completely deprecated or broken widgets:
list, tree, text, pixmap, paned and progressbar. These will have
to be redone from scratch.
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
......@@ -7,6 +19,10 @@ Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* demos/Makefile.am (INCLUDES): add -DGDK_PIXBUF_DISABLE_DEPRECATED.
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example
......
......@@ -7,6 +7,7 @@ INCLUDES = @STRIP_BEGIN@ \
-I$(top_builddir)/gdk \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
@GTK_DEBUG_FLAGS@ \
@GTK_DEP_CFLAGS@ \
......
This diff is collapsed.
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
arrow: arrow.c
$(CC) `pkg-config --cflags gtk+-2.0` arrow.c -o arrow `pkg-config --libs gtk+-2.0`
$(CC) arrow.c -o arrow $(DEPRECTATED) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o arrow
/* example-start arrow arrow.c */
#include <gtk/gtk.h>
......@@ -71,4 +70,3 @@ int main( int argc,
return(0);
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
aspectframe: aspectframe.c
$(CC) `pkg-config --cflags gtk+-2.0` aspectframe.c -o aspectframe `pkg-config --libs gtk+-2.0`
$(CC) aspectframe.c -o aspectframe $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o aspectframe
/* example-start aspectframe aspectframe.c */
#include <gtk/gtk.h>
......@@ -12,8 +11,8 @@ int main( int argc,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Aspect Frame");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
/* Create an aspect_frame and add it to our toplevel window */
......@@ -33,7 +32,7 @@ int main( int argc,
/* Ask for a 200x200 window, but the AspectFrame will give us a 200x100
* window since we are forcing a 2x1 aspect ratio */
gtk_widget_set_usize (drawing_area, 200, 200);
gtk_widget_set_size_request (drawing_area, 200, 200);
gtk_container_add (GTK_CONTAINER(aspect_frame), drawing_area);
gtk_widget_show (drawing_area);
......@@ -41,4 +40,3 @@ int main( int argc,
gtk_main ();
return 0;
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
base: base.c
$(CC) `pkg-config --cflags gtk+-2.0` base.c -o base `pkg-config --libs gtk+-2.0`
$(CC) base.c -o base $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o base
/* example-start base base.c */
#include <gtk/gtk.h>
......@@ -16,4 +15,3 @@ int main( int argc,
return(0);
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
buttonbox: buttonbox.c
$(CC) `pkg-config --cflags gtk+-2.0` buttonbox.c -o buttonbox `pkg-config --libs gtk+-2.0`
$(CC) buttonbox.c -o buttonbox $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o buttonbox
/* example-start buttonbox buttonbox.c */
#include <gtk/gtk.h>
......@@ -26,8 +25,8 @@ GtkWidget *create_bbox( gint horizontal,
/* Set the appearance of the Button Box */
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), spacing);
gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h);
gtk_box_set_spacing (GTK_BOX (bbox), spacing);
/*gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h);*/
button = gtk_button_new_with_label ("OK");
gtk_container_add (GTK_CONTAINER (bbox), button);
......@@ -57,9 +56,9 @@ int main( int argc,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
g_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
......@@ -119,4 +118,3 @@ int main( int argc,
return(0);
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
buttons: buttons.c
$(CC) `pkg-config --cflags gtk+-2.0` buttons.c -o buttons `pkg-config --libs gtk+-2.0`
$(CC) buttons.c -o buttons $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o buttons
/* example-start buttons buttons.c */
#include <stdlib.h>
#include <gtk/gtk.h>
/* Create a new hbox with an image and a label packed into it
......@@ -28,7 +28,7 @@ GtkWidget *xpm_label_box( GtkWidget *parent,
pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask,
&style->bg[GTK_STATE_NORMAL],
xpm_filename);
pixmapwid = gtk_pixmap_new (pixmap, mask);
pixmapwid = gtk_image_new_from_file (xpm_filename);
/* Create a label for the button */
label = gtk_label_new (label_text);
......@@ -52,7 +52,6 @@ void callback( GtkWidget *widget,
g_print ("Hello again - %s was pressed\n", (char *) data);
}
int main( int argc,
char *argv[] )
{
......@@ -68,12 +67,14 @@ int main( int argc,
gtk_window_set_title (GTK_WINDOW (window), "Pixmap'd Buttons!");
#if 1
/* It's a good idea to do this for all windows. */
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_exit), NULL);
g_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (exit), NULL);
gtk_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (gtk_exit), NULL);
g_signal_connect (GTK_OBJECT (window), "delete_event",
GTK_SIGNAL_FUNC (exit), NULL);
#endif
/* Sets the border width of the window. */
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
......@@ -83,8 +84,8 @@ int main( int argc,
button = gtk_button_new ();
/* Connect the "clicked" signal of the button to our callback */
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (callback), (gpointer) "cool button");
g_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (callback), (gpointer) "cool button");
/* This calls our box creating function */
box1 = xpm_label_box(window, "info.xpm", "cool button");
......@@ -105,4 +106,3 @@ int main( int argc,
return(0);
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
calendar: calendar.c
$(CC) `pkg-config --cflags gtk+-2.0` calendar.c -o calendar `pkg-config --libs gtk+-2.0`
$(CC) calendar.c -o calendar $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f calendar
/* example-start calendar calendar.c */
/*
* Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grnlund
* Copyright (C) 2000 Tony Gale
......@@ -70,14 +69,14 @@ void calendar_date_to_string( CalendarData *data,
void calendar_set_signal_strings( char *sig_str,
CalendarData *data)
{
gchar *prev_sig;
const gchar *prev_sig;
gtk_label_get (GTK_LABEL (data->prev_sig), &prev_sig);
gtk_label_set (GTK_LABEL (data->prev2_sig), prev_sig);
prev_sig = gtk_label_get_text (GTK_LABEL (data->prev_sig));
gtk_label_set_text (GTK_LABEL (data->prev2_sig), prev_sig);
gtk_label_get (GTK_LABEL (data->last_sig), &prev_sig);
gtk_label_set (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set (GTK_LABEL (data->last_sig), sig_str);
prev_sig = gtk_label_get_text (GTK_LABEL (data->last_sig));
gtk_label_set_text (GTK_LABEL (data->prev_sig), prev_sig);
gtk_label_set_text (GTK_LABEL (data->last_sig), sig_str);
}
void calendar_month_changed( GtkWidget *widget,
......@@ -188,19 +187,17 @@ void calendar_font_selection_ok( GtkWidget *button,
CalendarData *calendar )
{
GtkStyle *style;
GdkFont *font;
PangoFontDescription *font_desc;
calendar->font = gtk_font_selection_dialog_get_font_name(
GTK_FONT_SELECTION_DIALOG (calendar->font_dialog));
if (calendar->window)
{
font = gtk_font_selection_dialog_get_font(GTK_FONT_SELECTION_DIALOG(calendar->font_dialog));
if (font)
font_desc = pango_font_description_from_string (calendar->font);
if (font_desc)
{
style = gtk_style_copy (gtk_widget_get_style (calendar->window));
gdk_font_unref (style->font);
style->font = font;
gdk_font_ref (style->font);
style->font_desc = font_desc;
gtk_widget_set_style (calendar->window, style);
}
}
......@@ -216,19 +213,19 @@ void calendar_select_font( GtkWidget *button,
g_return_if_fail(GTK_IS_FONT_SELECTION_DIALOG(window));
calendar->font_dialog = window;
gtk_window_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&calendar->font_dialog);
g_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
&calendar->font_dialog);
gtk_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button),
"clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok),
calendar);
gtk_signal_connect_object (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (calendar->font_dialog));
g_signal_connect (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button),
"clicked", GTK_SIGNAL_FUNC(calendar_font_selection_ok),
calendar);
g_signal_connect_swapped (GTK_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button),
"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
GTK_OBJECT (calendar->font_dialog));
}
window=calendar->font_dialog;
if (!GTK_WIDGET_VISIBLE (window))
......@@ -276,15 +273,15 @@ void create_calendar()
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "GtkCalendar Example");
gtk_container_border_width (GTK_CONTAINER (window), 5);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
gtk_signal_connect(GTK_OBJECT(window), "delete-event",
GTK_SIGNAL_FUNC(gtk_false),
NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
g_signal_connect(GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
g_signal_connect(GTK_OBJECT(window), "delete-event",
GTK_SIGNAL_FUNC(gtk_false),
NULL);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, TRUE);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
vbox = gtk_vbox_new(FALSE, DEF_PAD);
gtk_container_add (GTK_CONTAINER (window), vbox);
......@@ -298,7 +295,7 @@ void create_calendar()
hbbox = gtk_hbutton_box_new();
gtk_box_pack_start(GTK_BOX(hbox), hbbox, FALSE, FALSE, DEF_PAD);
gtk_button_box_set_layout(GTK_BUTTON_BOX(hbbox), GTK_BUTTONBOX_SPREAD);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbbox), 5);
gtk_box_set_spacing (GTK_BOX (hbbox), 5);
/* Calendar widget */
frame = gtk_frame_new("Calendar");
......@@ -308,27 +305,27 @@ void create_calendar()
calendar_set_flags(&calendar_data);
gtk_calendar_mark_day ( GTK_CALENDAR(calendar), 19);
gtk_container_add( GTK_CONTAINER( frame), calendar);
gtk_signal_connect (GTK_OBJECT (calendar), "month_changed",
GTK_SIGNAL_FUNC (calendar_month_changed),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected",
GTK_SIGNAL_FUNC (calendar_day_selected),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_month",
GTK_SIGNAL_FUNC (calendar_prev_month),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_month",
GTK_SIGNAL_FUNC (calendar_next_month),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "prev_year",
GTK_SIGNAL_FUNC (calendar_prev_year),
&calendar_data);
gtk_signal_connect (GTK_OBJECT (calendar), "next_year",
GTK_SIGNAL_FUNC (calendar_next_year),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "month_changed",
GTK_SIGNAL_FUNC (calendar_month_changed),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "day_selected",
GTK_SIGNAL_FUNC (calendar_day_selected),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "day_selected_double_click",
GTK_SIGNAL_FUNC (calendar_day_selected_double_click),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "prev_month",
GTK_SIGNAL_FUNC (calendar_prev_month),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "next_month",
GTK_SIGNAL_FUNC (calendar_next_month),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "prev_year",
GTK_SIGNAL_FUNC (calendar_prev_year),
&calendar_data);
g_signal_connect (GTK_OBJECT (calendar), "next_year",
GTK_SIGNAL_FUNC (calendar_next_year),
&calendar_data);
separator = gtk_vseparator_new ();
......@@ -347,7 +344,7 @@ void create_calendar()
for (i = 0; i < 5; i++)
{
toggle = gtk_check_button_new_with_label(flags[i].label);
gtk_signal_connect (GTK_OBJECT (toggle),
g_signal_connect (GTK_OBJECT (toggle),
"toggled",
GTK_SIGNAL_FUNC(calendar_toggle_flag),
&calendar_data);
......@@ -356,7 +353,7 @@ void create_calendar()
}
/* Build the right font-button */
button = gtk_button_new_with_label("Font...");
gtk_signal_connect (GTK_OBJECT (button),
g_signal_connect (GTK_OBJECT (button),
"clicked",
GTK_SIGNAL_FUNC(calendar_select_font),
&calendar_data);
......@@ -398,7 +395,7 @@ void create_calendar()
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
button = gtk_button_new_with_label ("Close");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
g_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit),
NULL);
gtk_container_add (GTK_CONTAINER (bbox), button);
......@@ -418,6 +415,5 @@ int main(int argc,
gtk_main();
return(0);
return 0;
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
clist: clist.c
$(CC) `pkg-config --cflags gtk+-2.0` clist.c -o clist `pkg-config --libs gtk+-2.0`
$(CC) clist.c -o clist `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o clist
/* example-start clist clist.c */
#include <gtk/gtk.h>
......@@ -90,7 +89,7 @@ int main( int argc,
gtk_init(&argc, &argv);
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(GTK_WIDGET(window), 300, 150);
gtk_widget_set_size_request (GTK_WIDGET (window), 300, 150);
gtk_window_set_title(GTK_WINDOW(window), "GtkCList Example");
gtk_signal_connect(GTK_OBJECT(window),
......@@ -171,4 +170,3 @@ int main( int argc,
return(0);
}
/* example-end */
CC = gcc
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED
entry: entry.c
$(CC) `pkg-config --cflags gtk+-2.0` entry.c -o entry `pkg-config --libs gtk+-2.0`
$(CC) entry.c -o entry $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
clean:
rm -f *.o entry
/* example-start entry entry.c */
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
void enter_callback( GtkWidget *widget,
GtkWidget *entry )
{
gchar *entry_text;
const gchar *entry_text;
entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
printf("Entry contents: %s\n", entry_text);
}
......@@ -13,8 +14,8 @@ void enter_callback( GtkWidget *widget,
void entry_toggle_editable( GtkWidget *checkbutton,
GtkWidget *entry )
{
gtk_entry_set_editable(GTK_ENTRY(entry),
GTK_TOGGLE_BUTTON(checkbutton)