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

Re: gpointer in callback function



Thus spoke Gernot Kerschbaumer
> //connect signal:
> gtk_signal_connect(GTK_OBJECT(window), "delete_event",
> GTK_SIGNAL_FUNC(delete_ev), &key);     //key is an integer value
> 
> //callback function:
> gint XLogWindow::delete_ev(GtkWidget *w, GdkEvent *ev, gpointer *p)
> {
>    //doing something with data pointer p
>    ...
> 
>    return(false);
> }   

I don't think delete_events pass in the GdkEvent structure.  Try the
callback with only the GtkWidget and gpointer.

The callback formats don't seem to be uniform in 1.2 - or maybe I'm just
not catching what the pattern is.  In 1.0 you had to include the Widget
structure in the callback args, but in 1.0 you don't do so.  

For my part, until I figure out what the calling rules are, if I run across
this problem I try it with just the gpointer and then with the widget and
gpointer together to see what happens.
-- 
Michael J. Hammel           |
The Graphics Muse           | Tell me what you need, and I'll tell you how to
mjhammel@graphics-muse.org  | get along without it. -- Dilbert
http://www.graphics-muse.org



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