Re: Bindings in testgtk.c-> doc's



Hola Marisa!

  /* bindings test
   */
  binding_set = gtk_binding_set_by_class (gtk_type_class (GTK_TYPE_WIDGET));
  gtk_binding_entry_add_signal (binding_set,
    '9', GDK_CONTROL_MASK | GDK_RELEASE_MASK,
    "debug_msg",
    1,
    GTK_TYPE_STRING, "GtkWidgetClass <ctrl><release>9 test");
 .....

Questions:
-What are they for?
-What should be noticed if commenting them?
-Some explanation about 'gtk_binding_set_by_class()' and 'gtk_binding_entry_add_signal()', or where are 
they documented? I couldn't find anything.

Those lines make any subclass of GtkWidget to emit the signal
"debug_msg" any time you release Ctrl-9 sending a string as argument.

If you comment them, nothing will happen. If not, run the example and
press Ctrl-9. When you release it, you will see a message in console
like this:

(lt-testgtk:6541): Gtk-WARNING **: gtk_binding_entry_activate(): binding
"GtkWidget::<Release><Control>9": could not find signal "debug_msg" in
the `GtkHSV' class ancestry

but if the widget has the "debug_msg" signal registered and any handler
for it, it will call the callback function(s).

Documentation? Well, I actually had to look at the source, guess what it
does and test to see if i were right... ;-).

Cheers.

- Gonzalo

-- 
Gonzalo Paniagua Javier <gonzalo gnome-db org>
http://www.gnome-db.org/~gonzalo/




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