Re: newbie question: connecting signals to callbacks
- From: Tim Müller <t i m zen co uk>
- To: Neil Zanella <nzanella gmail com>, gtk-list gnome org
- Cc:
- Subject: Re: newbie question: connecting signals to callbacks
- Date: Tue, 2 Nov 2004 09:17:13 +0000
On Tuesday 02 November 2004 01:08, Neil Zanella wrote:
> I have a basic question which I would like to ask:
>
> The function prototype for gtk_main_quit() is:
>
> void gtk_main_quit(void);
>
> The GtkObject signal prototype for the "destroy" callback is:
>
> void user_function(GtkObject *object, gpointer user_data);
>
> Yet I can connect the two as follows:
>
> g_signal_connect(widget, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> My question is, is it always legal to connect a signal to a function
> with less parameter arguments than those described in the API?
Yes, it's fine to call a function with more arguments than it takes (in C).
Google for 'C calling convention' and 'caller clears stack' for details.
Cheers
-Tim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]