]> Pileus Git - ~andy/gtk/commitdiff
GtkTickCallback: document use of G_SOURCE_CONTINUE/REMOVE for return value
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 14 Feb 2013 21:24:27 +0000 (16:24 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 14 Feb 2013 22:19:53 +0000 (17:19 -0500)
Document that G_SOURCE_CONTINUE and G_SOURCE_REMOVE are the preferred
return values from a tick callback.

gtk/gtkwidget.c
gtk/gtkwidget.h
tests/animated-resizing.c

index 4b460661ecff7da426932e52f8dc62a0ab61f7f3..79cf9e2ea1e9782439613b89edfdfbfd6820f387 100644 (file)
@@ -4584,9 +4584,9 @@ gtk_widget_on_frame_clock_update (GdkFrameClock *frame_clock,
       ref_tick_callback_info (info);
       if (!info->destroyed)
         {
-          if (!info->callback (widget,
-                               frame_clock,
-                               info->user_data))
+          if (info->callback (widget,
+                              frame_clock,
+                              info->user_data) == G_SOURCE_REMOVE)
             {
               destroy_tick_callback_info (widget, info, l);
             }
index c082c13510d2051dbfcde5836164f681dc2c2650..064fb078785ed8d1b156d80b1728ffab322c3bb7 100644 (file)
@@ -94,8 +94,8 @@ typedef void    (*GtkCallback)     (GtkWidget        *widget,
  *
  * Callback type for adding a function to update animations. See gtk_widget_add_tick_callback().
  *
- * Returns: %TRUE if the tick callback should continue to be called,
- *  %FALSE if the tick callback should be removed.
+ * Returns: %G_SOURCE_CONTINUE if the tick callback should continue to be called,
+ *  %G_SOURCE_REMOVE if the tick callback should be removed.
  */
 typedef gboolean (*GtkTickCallback) (GtkWidget     *widget,
                                      GdkFrameClock *frame_clock,
index df2fe48c9260b1638ae191cea45a06feca289449..8a34d9fc38201aaa45661b2b99fff4517d8c7bf9 100644 (file)
@@ -251,7 +251,7 @@ tick_callback (GtkWidget     *widget,
   scaled_time = (frame_time - start_frame_time) / (CYCLE_TIME * 1000000);
   on_frame (scaled_time - floor (scaled_time));
 
-  return TRUE;
+  return G_SOURCE_CONTINUE;
 }
 
 static gboolean