On Fri, 7 Jul 2000, Niklas H�glund wrote:
Hi,
> Hi!
> I have some trouble using eventbox'es.
>
> I create a eventbox and I connect a signal to it...
>
> >gtk_signal_connect (GTK_OBJECT(event_box), "button_press_event",
> > GTK_SIGNAL_FUNC (gw), GINT_TO_POINTER(var));
>
> but when in the gw() function print the var it is wrong...
> > g_print("got: %d \n", GPOINTER_TO_INT(data));
>
> (see eventbox.c that I've attached)
>
> Anyone have any clue what I've done wrong?
Your 'gw' function is defined as follows in your code:
void gw(GtkWidget *widget, gpointer data)
{
g_print("got: %d \n", GPOINTER_TO_INT(data));
}
But for "button_press_event" signal the callback prototype expected is
gboolean gw(GtkWidget *widget, GdkEventButton *event, gpointer user_data);
So redeclare your 'gw' this way and all should work as expected.
> //Mvh Niklas
>
Best regards,
-Vlad
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list