Re: [gtk-list] signal/slot question



Robert Wilhelm <robert@physiol.med.tu-muenchen.de> writes:
> Doing a gtk_signal_connect(), the data (last argument) does not reach
> the callback function.
> 
> What I am doing wrong here?
> 
> Robert
> 
> #include <gtk/gtk.h>
> 
> static void  cb(GtkWidget* widget, gpointer data)
> {
>   printf("cb %p %p %p\n",widget,data, *(void **) data);
> }

All *_event signals take one argument, your callback only has one argument cept
the widget... You should have 3 args in the callback.

>   gtk_signal_connect(GTK_OBJECT(window),"button_press_event",GTK_SIGNAL_FUNC(cb),window);
>   gtk_signal_connect(GTK_OBJECT(window),"button_release_event",GTK_SIGNAL_FUNC(cb),NULL);

-- 
-- Tero Pulkkinen -- terop@modeemi.cs.tut.fi --



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