Re: function type



>> >gboolean AddButton(gint* id, gchar* label, function_type callback,
>> >gpointer data);
>> >
>> >Which type should I use for the callback? Something like GtkSignalFunc??
>>
>> can't be answered without knowing which signal you plan on connecting to.
>> clicked ? button_press ? button_release ? enter_notify? etc.
>
>It's a button_press signal

well then, to avoid using casts to fool the compiler:

typedef gint (*this_particular_function_type)(GtkWidget *, 
                                              GdkEventButton *);

though this would also be possible:

typedef gint (*this_particular_function_type)(GtkWidget *, 
                                              GdkEventButton *,
					      gpointer extra_arg);

You can get this from the documentation at www.gtk.org, where it
describes each signal.

Or you could choose not to obey orders and use Gtk-- and forget all
this nonsense :))

--p





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