Re: callback function without arguments
- From: Owen Taylor <otaylor redhat com>
- To: Shiraz Baig <shiraz_baig yahoo com>
- Cc: gtk-list gnome org
- Subject: Re: callback function without arguments
- Date: 06 May 2003 14:36:59 -0400
On Tue, 2003-05-06 at 01:09, Shiraz Baig wrote:
> I have defined a callback function for "clicking" of a
> button. I have not used the normal form of
>
> callback(GtkWidget *widget, gpointer data).
>
> Instead, I have used a callback without any arugments.
> (See the example given below).
>
> My question is
>
> "Is there anything wrong in doing so, when I do not
> need to dereference the widget or the data?"
GTK+ relies on this ability in various places internally
and it is quite safe on any machine you are likely to
ever run on. (Though it isn't guaranteed by the C standard.)
Regards,
Owen
[
What you can't do is use a callback with *more* arguments
than it is called with, even if you don't reference
the extra arguments. This will break various assumptions
used by the compiler.
]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]