]> Pileus Git - ~andy/gtk/commitdiff
Remove deprecated functions in examples. (#129074, Olexiy Avramchenko)
authorMatthias Clasen <maclas@gmx.de>
Fri, 12 Dec 2003 00:16:14 +0000 (00:16 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 12 Dec 2003 00:16:14 +0000 (00:16 +0000)
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.

13 files changed:
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/tutorial/gtk-tut.sgml
examples/calendar/Makefile
examples/gtkdial/gtkdial.c
examples/menu/Makefile
examples/menu/menu.c
examples/progressbar/progressbar.c
examples/rangewidgets/Makefile
examples/scribble-xinput/scribble-xinput.c

index 8cb899c722cf66c041984744bc3d5651d38cd1de..f3f2ca99bc3fe11c60d3d30fbd7056535c3932d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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): 
index 8cb899c722cf66c041984744bc3d5651d38cd1de..f3f2ca99bc3fe11c60d3d30fbd7056535c3932d6 100644 (file)
@@ -1,3 +1,16 @@
+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): 
index 8cb899c722cf66c041984744bc3d5651d38cd1de..f3f2ca99bc3fe11c60d3d30fbd7056535c3932d6 100644 (file)
@@ -1,3 +1,16 @@
+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): 
index 8cb899c722cf66c041984744bc3d5651d38cd1de..f3f2ca99bc3fe11c60d3d30fbd7056535c3932d6 100644 (file)
@@ -1,3 +1,16 @@
+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): 
index 8cb899c722cf66c041984744bc3d5651d38cd1de..f3f2ca99bc3fe11c60d3d30fbd7056535c3932d6 100644 (file)
@@ -1,3 +1,16 @@
+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): 
index ff8b0f8f1535de30912ec625ab3c6a74581a1f8c..1403587055a913dfb2fbfcd7bf499a3c2aca59d9 100755 (executable)
@@ -3993,8 +3993,8 @@ static void toggle_orientation( GtkWidget    *widget,
     gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (pdata-&gt;pbar), 
                                      GTK_PROGRESS_LEFT_TO_RIGHT);
     break;
-  default:
-    // do nothing      
+  default:;
+    /* do nothing */
   }
 }
 
@@ -4003,7 +4003,7 @@ static void toggle_orientation( GtkWidget    *widget,
 static void destroy_progress( GtkWidget    *widget,
                               ProgressData *pdata)
 {
-    gtk_timeout_remove (pdata-&gt;timer);
+    g_source_remove (pdata-&gt;timer);
     pdata-&gt;timer = 0;
     pdata-&gt;window = NULL;
     g_free (pdata);
@@ -4052,7 +4052,7 @@ int main( int   argc,
     gtk_widget_show (pdata-&gt;pbar);
 
     /* Add a timer callback to update the value of the progress bar */
-    pdata-&gt;timer = gtk_timeout_add (100, progress_timeout, pdata);
+    pdata-&gt;timer = g_timeout_add (100, progress_timeout, pdata);
 
     separator = gtk_hseparator_new ();
     gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
@@ -9309,9 +9309,9 @@ create a timeout function that will be called every "interval"
 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
@@ -9321,7 +9321,7 @@ value is an integer "tag" which may be used to stop the timeout by
 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
@@ -9332,7 +9332,7 @@ i.e., TRUE.</para>
 <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>
@@ -12141,7 +12141,7 @@ value of the control to be recomputed (by the function
 <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">
@@ -12208,7 +12208,7 @@ gtk_dial_button_release( GtkWidget      *widget,
       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))
@@ -12315,11 +12315,11 @@ gtk_dial_update_mouse (GtkDial *dial, gint x, gint y)
          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);
            }
        }
     }
@@ -15384,7 +15384,7 @@ gtk_dial_button_release( GtkWidget      *widget,
       dial-&gt;button = 0;
 
       if (dial-&gt;policy == GTK_UPDATE_DELAYED)
-       gtk_timeout_remove (dial-&gt;timer);
+       g_source_remove (dial-&gt;timer);
       
       if ((dial-&gt;policy != GTK_UPDATE_CONTINUOUS) &amp;&amp;
          (dial-&gt;old_value != dial-&gt;adjustment-&gt;value))
@@ -15491,11 +15491,11 @@ gtk_dial_update_mouse( GtkDial *dial, gint x, gint y )
          if (dial-&gt;policy == GTK_UPDATE_DELAYED)
            {
              if (dial-&gt;timer)
-               gtk_timeout_remove (dial-&gt;timer);
+               g_source_remove (dial-&gt;timer);
 
-             dial-&gt;timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
-                                            (GtkFunction) gtk_dial_timer,
-                                            (gpointer) dial);
+             dial-&gt;timer = g_timeout_add (SCROLL_DELAY_LENGTH,
+                                          (GtkFunction) gtk_dial_timer,
+                                          (gpointer) dial);
            }
        }
     }
@@ -16035,11 +16035,6 @@ create_input_dialog ()
 }
 
 void
-quit ()
-{
-  exit (0);
-}
-
 int
 main (int argc, char *argv[])
 {
@@ -16059,7 +16054,7 @@ 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 */
 
index a27b6a7940341b47147f207064c5283684eab32d..476f98c2d7803cf98a6eb27bc0513c8229e0ef7a 100644 (file)
@@ -4,8 +4,7 @@ CC = gcc
 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`
index 76526d673d17d0bc40ba6fddbe58419e58684574..402472d4252ecd54433e7ad68483998d4bd3d1c6 100644 (file)
@@ -45,7 +45,7 @@ static gint gtk_dial_button_release           (GtkWidget        *widget,
                                                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);
@@ -476,7 +476,7 @@ gtk_dial_button_release (GtkWidget      *widget,
       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))
@@ -531,7 +531,7 @@ gtk_dial_motion_notify (GtkWidget      *widget,
   return FALSE;
 }
 
-static gint
+static gboolean
 gtk_dial_timer (GtkDial *dial)
 {
   g_return_val_if_fail (dial != NULL, FALSE);
@@ -583,11 +583,11 @@ gtk_dial_update_mouse (GtkDial *dial, gint x, gint y)
          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);
            }
        }
     }
index 290ac17922c119ccaef30454ce84f8e6c3aa860a..1ce3218d8e248ea89b533bae4f6d43a9c7743bef 100644 (file)
@@ -4,8 +4,7 @@ CC = gcc
 CFLAGS = -Wall                         \
        -DG_DISABLE_DEPRECATED          \
        -DGDK_DISABLE_DEPRECATED        \
-       -DGDK_PIXBUF_DISABLE_DEPRECATED \
-       -DGTK_DISABLE_DEPRECATED
+       -DGDK_PIXBUF_DISABLE_DEPRECATED
 
 all: menu itemfactory
 
index 970c2fe61e0c7ac067ed6a0c64842bfbda3e2530..94271df94d0d5c9b9d6a981b54e7429984672a4b 100644 (file)
@@ -69,7 +69,7 @@ int main( int   argc,
 
     /* 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);
index f4a9aec8efb9d28c54f6cdd0f2440995ab5594af..cec619ea5dbf0e99686cb4c83636979b5928da9b 100644 (file)
@@ -10,7 +10,7 @@ typedef struct _ProgressData {
 
 /* 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;
@@ -74,8 +74,8 @@ void toggle_orientation( GtkWidget    *widget,
     gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (pdata->pbar), 
                                      GTK_PROGRESS_LEFT_TO_RIGHT);
     break;
-  default:
-    // do nothing      
+  default: ;
+    /* do nothing */
   }
 }
 
@@ -84,7 +84,7 @@ void toggle_orientation( GtkWidget    *widget,
 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);
@@ -133,7 +133,7 @@ int main( int   argc,
     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);
index 4ca6e0dd3d96aa3f46d0878606e49955af95b883..f018f81ec9d33dfd205126889fc2e53920eb6c4b 100644 (file)
@@ -4,8 +4,7 @@ CC = gcc
 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`
index 2a2909b1031cc7e35bb6232886bfcdf553e0fd7a..ed1b3d715d162822a0b02a49aaf69669dcf00b33 100644 (file)
@@ -176,12 +176,6 @@ create_input_dialog ()
     }
 }
 
-void
-quit ()
-{
-  exit (0);
-}
-
 int
 main (int argc, char *argv[])
 {
@@ -201,7 +195,7 @@ 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 */