Re: callback parameters



Jeff Edwards <ecsi@sprynet.com> writes:
> Could someone please explain to me why it is reasonable to connect
> gtk_widget_destroy() to a button clicked signal, when
> gtk_widget_destroy() takes only one parameter?
> 
> As far as I can tell by reading the GTK+ source code, the callbacks for
> button clicked signals (and every signal, for that matter) _always_ get
> called with at least two arguments. Won't calling a function that
> expects only one argument potentially screw up the stack? Admittedly, it
> seems of work OK in actual practive, but is it really legitimate?
> 

It works on all systems anyone's tried GTK on (win32, pretty much any
UNIX, BeOS). But no, I'm pretty sure the C spec doesn't guarantee that
it will work. comp.lang.c is full of language lawyers who could tell
you. ;-)

Havoc





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