[clutter] cookbooks/examples: Use g_signal_handlers_disconnect_by_func()



commit 72caef0de010d1f6797c29157806a81e72c3f818
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri Sep 2 11:01:36 2011 +0100

    cookbooks/examples: Use g_signal_handlers_disconnect_by_func()
    
    The disconnect_matched() function is a bit too complicated, and its
    simpler wrapper disconnect_by_func() is functionally equivalent in the
    cases used by the cookbook examples.

 doc/cookbook/animations.xml              |    8 ++------
 doc/cookbook/examples/animations-reuse.c |    8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/doc/cookbook/animations.xml b/doc/cookbook/animations.xml
index 4d65555..66c4fab 100644
--- a/doc/cookbook/animations.xml
+++ b/doc/cookbook/animations.xml
@@ -1580,12 +1580,8 @@ foo_button_pressed_cb (ClutterActor *actor,
                               NULL);
 
   /* remove the button press handler from the rectangle */
-  g_signal_handlers_disconnect_matched (actor,
-                                        G_SIGNAL_MATCH_FUNC,
-                                        0,
-                                        0,
-                                        NULL,
-                                        foo_button_pressed_cb,
+  g_signal_handlers_disconnect_by_func (actor,
+                                        G_CALLBACK (foo_button_pressed_cb),
                                         NULL);
 
   /* add a callback to clean up the script when the rig is destroyed */
diff --git a/doc/cookbook/examples/animations-reuse.c b/doc/cookbook/examples/animations-reuse.c
index b733733..d5125e0 100644
--- a/doc/cookbook/examples/animations-reuse.c
+++ b/doc/cookbook/examples/animations-reuse.c
@@ -46,12 +46,8 @@ foo_button_pressed_cb (ClutterActor *actor,
                               NULL);
 
   /* remove the button press handler from the rectangle */
-  g_signal_handlers_disconnect_matched (actor,
-                                        G_SIGNAL_MATCH_FUNC,
-                                        0,
-                                        0,
-                                        NULL,
-                                        foo_button_pressed_cb,
+  g_signal_handlers_disconnect_by_func (actor,
+                                        G_CALLBACK (foo_button_pressed_cb),
                                         NULL);
 
   /* add a callback to clean up the script when the rig is destroyed */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]