On Tue, Aug 10, 2010 at 02:41, Erik de Castro Lopo mle+tools@mega-nerd.com wrote:
Lex Trotman wrote:
While this works fine and the handlers are only one line each, another way would have been to use one handler and set different user_data for each menu item.
To be explicit, you can do:
g_signal_connect ((gpointer) indent_width_1, "activate", G_CALLBACK (on_indent_width_activate), GUINT_TO_POINTER (1));
g_signal_connect ((gpointer) indent_width_2, "activate", G_CALLBACK (on_indent_width_activate), GUINT_TO_POINTER (2));
and in the on_indent_width_activate() callback use
GPOINTER_TO_INT(user_data)
to get the int back.
Sure, you can do it when connecting callbacks to signals manually. But how do you do this with glade (2.12)? I was searching for some possibility to pass user data but without any success and that's why I decided first to check the labels and later to use different callbacks. I think it's not possible - no other glade-defined callback in geany uses callback data either.
Jiri
Erik
Erik de Castro Lopo http://www.mega-nerd.com/ _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel