[Glade-users] Passing objects to libglade callbacks
Günther Mittermayer
g_mitter@web.de
Tue, 5 Aug 2003 12:12:13 +0200
Russell,
I'm not sure on what you want to do, but I think you might be using the Object field in a wrong manner... I might be just guessing, since I actually never used it, but I think it is used to determine the object which should receive the specified signal, and therefore, "1" doesn't make any sense to me.....
I would try finding out what it really means.. and again, I'm just guessing..
Günther.
Russell Shaw <rjshaw@iprimus.com.au> schrieb am 05.08.03 10:16:10:
>
> Hi,
> I put a button on a glade-2.0 window. In the properties form,
> i selected the "clicked" signal. For the handler, i entered
> "on_button_clicked". For the object, i entered "1" (without
> the quotes).
>
> In the following gtk+2 program, when i click the button, the
> on_button_clicked callback prints a very large integer instead
> of "1". Why?
>
> #include <gtk/gtk.h>
> #include <glade/glade.h>
> #include <glib.h>
>
> void on_button_clicked(GtkWidget *widget, gpointer user_data) {
> g_print("Butt=%d\n",GPOINTER_TO_INT(user_data));
> // g_print("Butt=%d\n",*((gint*)user_data));
> }
>
> int main(int argc, char *argv[])
> {
> GladeXML *xml;
>
> gtk_init(&argc, &argv);
> glade_init();
>
> /* load the interface */
> xml = glade_xml_new("keypad.glade",NULL,NULL);
> /* connect the signals in the interface */
> glade_xml_signal_autoconnect(xml);
> /* start the event loop */
> gtk_main();
> return 0;
> }
>
> _______________________________________________
> Glade-users maillist - Glade-users@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
______________________________________________________________________________
ComputerBild (15-03) empfiehlt: Der beste Spam-Schutz ist bei
WEB.DE FreeMail - Deutschlands beste E-Mail - http://s.web.de/?mc=021124