[Glade-users] signal handler with arguments from property editor

mw158979 newbie at poczta.gazeta.pl
Thu Feb 9 15:38:59 EST 2006


----- Original Message ----- 
From: "Tristan Van Berkom" <tristan.van.berkom at gmail.com>
To: "mw158979" <newbie at poczta.gazeta.pl>
Cc: <glade-users at lists.ximian.com>
Sent: Thursday, February 09, 2006 8:13 PM
Subject: Re: [Glade-users] signal handler with arguments from property
editor


> >That argument you will receive in your callback (as user_data).
> >
> >
> Well, I'm not exactly sure about the code that glade-2
> generates, but libglade uses that feild to lookup a widget
> by that name and connect the object as user_data.
>
> I assume the code glade-2 would generate would look like:
>     g_signal_connect (button, "clicked", my_hanlder, lookup_widget
> ("my_object"));
> where you put "my_object" in the "object" field.

Without lookup (it is obsolete, since widgets are declared
as their names), but it is converted to GtkObject*, so it
should not be an arbitrary data:

  g_signal_connect_swapped ((gpointer) button1, "clicked",
                            G_CALLBACK (on_button1_clicked),
                            GTK_OBJECT (window1));


> Either way, if you are useing code generation, you can modify the
> generated code and use a string constant for user data

or just assign signals in your code at startup, then you can
set the user_data you like, and don't have to fight with overwriting
interface.c.

cheers


-- 
Wysokie Obroty Magazyn - nowy miesiecznik motoryzacyjny. Pierwszy numer juz w sprzedazy.
Wiecej informacji na: http://auto.gazeta.pl/auto/0,0.html


More information about the Glade-users mailing list