Re: Please explain 1st arg of configure & expose event functions...



>Examples of configure and expose event functions
>have a mysterious GtkWidget for the first arg.
>I cannot seem to discern what it is.

often, a signal is emitted because of an event occuring in/on the
widget. the handler(s) for the signal receive a pointer to the widget
as their first argument. this allows them to know which widget they
are dealing with (since the same function might be used to handle
similar signals for many different widgets).

>What is all this widget->allocation.height, widget->window stuff and where
>did it come from and why is it useful?

if you are going to do "low level" drawing in a widget, you need to
know how big the widget is, and you need access to the GdkWindow that
is actually the object in which drawing occurs. these are members of
all GtkWidgets (though the GdkWindow member is only valid after the
widget has been realized - it corresponds (when using XWindow) to an
actual X window).

--p



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