Errors in GTK Tutorial?





Hello there...

	I better start by explaining that not only am I new to GTK+, but I've
never used any other GUI toolkit. Perhaps I should have started with
something where documentation has been written.... naah! ;)

	So far I've not been able to find much in the way of documentation for
gtk, but the best source I've found is gtk_tutorial.990225, which I've been
working from, as well as what exists of the gtk-docs.

	My question concerns signals / events which seem to be the least well
explained part of the tutorial. From what I understand from the tutorial
events are a type of signal, but one whose callback functions have
_different_ parameters (GtkWidget *, GdkEvent *, gpointer data) rather than
(GtkWidget *, gpointer data) of a normal signal handler. Event callbacks are
also expected to return a gboolean to signify whether or not the event has
been handled (I assume the return type of gint in helloworld should have
been gboolean - yes I know they're the same but why have then in the first
place if you're not going to use them!).

	All this I think is fairly clear - so why do most of the event handlers
in the rest of the tutorial NOT return anything? Isn't this going to either
going to produce random return values, on systems when arguments to
functions
are passed in registers, or stack corruption when arguments are passed on
the
stack? In other examples motion_notify_event (GtkWidget *widget,
GdkEventMotion *event) is used - again would this not cause stack corruption
when called with arguments (widget, event, data) on systems that use the
stack for passing arguments?

       Have I completely misunderstood GTK+'s signals & events or is the
tutorial simply bugridden?

	The descriptions of the widgets etc in the tutorial seems to be very
good, however without more information about signals etc it seems rather
difficult to make use of these. Perhaps adding more information about what
gtk does in gtk_main could be added to the tutorial soon, rather than
concentrating on documenting all the remaining widgets. For example
gtk_main_iteration and information on nesting gtk_main's (which I assume is
legal use - both from trying it, and from the existance of the
gtk_main_level function) would be very useful.

Thanks for taking the time to read this message.



Chris Wilson.

cdw22@cam.ac.uk





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