+Fri Dec 12 01:13:34 2003 Matthias Clasen <maclas@gmx.de>
+
+ * examples/gtkdial/gtkdial.c:
+ * examples/menu/menu.c:
+ * examples/scribble-xinput/scribble-xinput.c:
+ * examples/progressbar/progressbar.c:
+ * docs/tutorial/gtk-tut.sgml: Remove deprecated functions
+ in examples. (#129074, Olexiy Avramchenko)
+ * examples/calendar/Makefile:
+ * examples/rangewidgets/Makefile:
+ * examples/menu/Makefile: Allow deprecated functions in
+ examples which use deprecated widgets.
+
Fri Dec 12 00:43:16 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c (gdk_threads_set_lock_functions):
+Fri Dec 12 01:13:34 2003 Matthias Clasen <maclas@gmx.de>
+
+ * examples/gtkdial/gtkdial.c:
+ * examples/menu/menu.c:
+ * examples/scribble-xinput/scribble-xinput.c:
+ * examples/progressbar/progressbar.c:
+ * docs/tutorial/gtk-tut.sgml: Remove deprecated functions
+ in examples. (#129074, Olexiy Avramchenko)
+ * examples/calendar/Makefile:
+ * examples/rangewidgets/Makefile:
+ * examples/menu/Makefile: Allow deprecated functions in
+ examples which use deprecated widgets.
+
Fri Dec 12 00:43:16 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c (gdk_threads_set_lock_functions):
+Fri Dec 12 01:13:34 2003 Matthias Clasen <maclas@gmx.de>
+
+ * examples/gtkdial/gtkdial.c:
+ * examples/menu/menu.c:
+ * examples/scribble-xinput/scribble-xinput.c:
+ * examples/progressbar/progressbar.c:
+ * docs/tutorial/gtk-tut.sgml: Remove deprecated functions
+ in examples. (#129074, Olexiy Avramchenko)
+ * examples/calendar/Makefile:
+ * examples/rangewidgets/Makefile:
+ * examples/menu/Makefile: Allow deprecated functions in
+ examples which use deprecated widgets.
+
Fri Dec 12 00:43:16 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c (gdk_threads_set_lock_functions):
+Fri Dec 12 01:13:34 2003 Matthias Clasen <maclas@gmx.de>
+
+ * examples/gtkdial/gtkdial.c:
+ * examples/menu/menu.c:
+ * examples/scribble-xinput/scribble-xinput.c:
+ * examples/progressbar/progressbar.c:
+ * docs/tutorial/gtk-tut.sgml: Remove deprecated functions
+ in examples. (#129074, Olexiy Avramchenko)
+ * examples/calendar/Makefile:
+ * examples/rangewidgets/Makefile:
+ * examples/menu/Makefile: Allow deprecated functions in
+ examples which use deprecated widgets.
+
Fri Dec 12 00:43:16 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c (gdk_threads_set_lock_functions):
+Fri Dec 12 01:13:34 2003 Matthias Clasen <maclas@gmx.de>
+
+ * examples/gtkdial/gtkdial.c:
+ * examples/menu/menu.c:
+ * examples/scribble-xinput/scribble-xinput.c:
+ * examples/progressbar/progressbar.c:
+ * docs/tutorial/gtk-tut.sgml: Remove deprecated functions
+ in examples. (#129074, Olexiy Avramchenko)
+ * examples/calendar/Makefile:
+ * examples/rangewidgets/Makefile:
+ * examples/menu/Makefile: Allow deprecated functions in
+ examples which use deprecated widgets.
+
Fri Dec 12 00:43:16 2003 Matthias Clasen <maclas@gmx.de>
* gdk/gdk.c (gdk_threads_set_lock_functions):
gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (pdata->pbar),
GTK_PROGRESS_LEFT_TO_RIGHT);
break;
- default:
- // do nothing
+ default:;
+ /* do nothing */
}
}
static void destroy_progress( GtkWidget *widget,
ProgressData *pdata)
{
- gtk_timeout_remove (pdata->timer);
+ g_source_remove (pdata->timer);
pdata->timer = 0;
pdata->window = NULL;
g_free (pdata);
gtk_widget_show (pdata->pbar);
/* Add a timer callback to update the value of the progress bar */
- pdata->timer = gtk_timeout_add (100, progress_timeout, pdata);
+ pdata->timer = g_timeout_add (100, progress_timeout, pdata);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
milliseconds.</para>
<programlisting role="C">
-gint gtk_timeout_add( guint32 interval,
- GtkFunction function,
- gpointer data );
+gint g_timeout_add (guint32 interval,
+ GtkFunction function,
+ gpointer data);
</programlisting>
<para>The first argument is the number of milliseconds between calls to your
calling:</para>
<programlisting role="C">
-void gtk_timeout_remove( gint tag );
+void g_source_remove (gint tag);
</programlisting>
<para>You may also stop the timeout function by returning zero or FALSE from
<para>The declaration of your callback should look something like this:</para>
<programlisting role="C">
-gint timeout_callback( gpointer data );
+gint timeout_callback (gpointer data);
</programlisting>
</sect1>
<literal>gtk_dial_update_mouse</literal>). Depending on the policy that has been
set, "value_changed" events are either generated instantly
(<literal>GTK_UPDATE_CONTINUOUS</literal>), after a delay in a timer added with
-<literal>gtk_timeout_add()</literal> (<literal>GTK_UPDATE_DELAYED</literal>), or only when the
+<literal>g_timeout_add()</literal> (<literal>GTK_UPDATE_DELAYED</literal>), or only when the
button is released (<literal>GTK_UPDATE_DISCONTINUOUS</literal>).</para>
<programlisting role="C">
dial->button = 0;
if (dial->policy == GTK_UPDATE_DELAYED)
- gtk_timeout_remove (dial->timer);
+ g_source_remove (dial->timer);
if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
(dial->old_value != dial->adjustment->value))
if (dial->policy == GTK_UPDATE_DELAYED)
{
if (dial->timer)
- gtk_timeout_remove (dial->timer);
+ g_source_remove (dial->timer);
- dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
- (GtkFunction) gtk_dial_timer,
- (gpointer) dial);
+ dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+ (GtkFunction) gtk_dial_timer,
+ (gpointer) dial);
}
}
}
dial->button = 0;
if (dial->policy == GTK_UPDATE_DELAYED)
- gtk_timeout_remove (dial->timer);
+ g_source_remove (dial->timer);
if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
(dial->old_value != dial->adjustment->value))
if (dial->policy == GTK_UPDATE_DELAYED)
{
if (dial->timer)
- gtk_timeout_remove (dial->timer);
+ g_source_remove (dial->timer);
- dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
- (GtkFunction) gtk_dial_timer,
- (gpointer) dial);
+ dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+ (GtkFunction) gtk_dial_timer,
+ (gpointer) dial);
}
}
}
}
void
-quit ()
-{
- exit (0);
-}
-
int
main (int argc, char *argv[])
{
gtk_widget_show (vbox);
g_signal_connect (G_OBJECT (window), "destroy",
- G_CALLBACK (quit), NULL);
+ G_CALLBACK (gtk_main_quit), NULL);
/* Create the drawing area */
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
- -DGDK_PIXBUF_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED
+ -DGDK_PIXBUF_DISABLE_DEPRECATED
calendar: calendar.c
$(CC) calendar.c -o calendar $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
GdkEventButton *event);
static gint gtk_dial_motion_notify (GtkWidget *widget,
GdkEventMotion *event);
-static gint gtk_dial_timer (GtkDial *dial);
+static gboolean gtk_dial_timer (GtkDial *dial);
static void gtk_dial_update_mouse (GtkDial *dial, gint x, gint y);
static void gtk_dial_update (GtkDial *dial);
dial->button = 0;
if (dial->policy == GTK_UPDATE_DELAYED)
- gtk_timeout_remove (dial->timer);
+ g_source_remove (dial->timer);
if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
(dial->old_value != dial->adjustment->value))
return FALSE;
}
-static gint
+static gboolean
gtk_dial_timer (GtkDial *dial)
{
g_return_val_if_fail (dial != NULL, FALSE);
if (dial->policy == GTK_UPDATE_DELAYED)
{
if (dial->timer)
- gtk_timeout_remove (dial->timer);
+ g_source_remove (dial->timer);
- dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
- (GtkFunction) gtk_dial_timer,
- (gpointer) dial);
+ dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+ (GtkFunction) gtk_dial_timer,
+ (gpointer) dial);
}
}
}
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
- -DGDK_PIXBUF_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED
+ -DGDK_PIXBUF_DISABLE_DEPRECATED
all: menu itemfactory
/* Now we specify that we want our newly created "menu" to be the menu
* for the "root menu" */
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), h);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (root_menu), menu);
/* A vbox to put a menu and a button in: */
vbox = gtk_vbox_new (FALSE, 0);
/* Update the value of the progress bar so that we get
* some movement */
-gint progress_timeout( gpointer data )
+gboolean progress_timeout( gpointer data )
{
ProgressData *pdata = (ProgressData *)data;
gdouble new_val;
gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (pdata->pbar),
GTK_PROGRESS_LEFT_TO_RIGHT);
break;
- default:
- // do nothing
+ default: ;
+ /* do nothing */
}
}
void destroy_progress( GtkWidget *widget,
ProgressData *pdata)
{
- gtk_timeout_remove (pdata->timer);
+ g_source_remove (pdata->timer);
pdata->timer = 0;
pdata->window = NULL;
g_free (pdata);
gtk_widget_show (pdata->pbar);
/* Add a timer callback to update the value of the progress bar */
- pdata->timer = gtk_timeout_add (100, progress_timeout, pdata);
+ pdata->timer = g_timeout_add (100, progress_timeout, pdata);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
CFLAGS = -Wall \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
- -DGDK_PIXBUF_DISABLE_DEPRECATED \
- -DGTK_DISABLE_DEPRECATED
+ -DGDK_PIXBUF_DISABLE_DEPRECATED
rangewidgets: rangewidgets.c
$(CC) rangewidgets.c -o rangewidgets $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
}
}
-void
-quit ()
-{
- exit (0);
-}
-
int
main (int argc, char *argv[])
{
gtk_widget_show (vbox);
g_signal_connect (G_OBJECT (window), "destroy",
- G_CALLBACK (quit), NULL);
+ G_CALLBACK (gtk_main_quit), NULL);
/* Create the drawing area */