Re: [gtk-list] Re: Gtk Question



> On Wed, 27 May 1998, Achint Sandhu wrote:
> > trying to pass data to the "callback" for the "delete_event" handler for
> > a window and can't seem to get it to work.....
> 
> the delete_event handler takes an additional argument (like all
> _event signals):
> gint delete_event_handler (GtkWidget          *widget,
>                            GdkEventAny        *event,
>                            gpointer            data);
>                                       
> >   gtk_signal_connect(GTK_OBJECT(window), "delete_event",
> >                      GTK_SIGNAL_FUNC(windowSignalHandlerStub), 
> >                      (gpointer) aCommand);
> > 
>

Guys (Owen, Shawn, Tim etc): Achint Sandhu has just been caught by this,
I got caught by it a few weeks ago, everyone gets caught by it! You are being
very patient in pointing out the same solution time and time again, but don't
you think it might be time to add a routine 'gtk_event_signal_connect()' to
the API? It would look just like  'gtk_signal_connect()', but would insist on
a GTK_EVENT_SIGNAL_FUNC as its 3rd arg.

With a bit of careful prototyping, you'd be able to get the C compiler to
spot when yet another newbie is trying to connect the wrong sort of callback
to the wrong sort of signal.

It might save you having to type so many replies like this one from Tim!

--

Steve                                       | Steve's law of House Rewiring:
S.Hosgood@swansea.ac.uk                     | "No matter how many power sockets
Phone: +44 1792 297292 + ask for Steve      |  you fit in a room, you will run
Fax:   +44 1792 295811                      |  out within the first week of use
--------------------------------------------+  even if you took Steve's law of
http://iiit.swan.ac.uk/~iisteve/steve.html  |  House Rewiring into account"




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