Re: Error is New Riders Book




RubenSafir mrbrklyn com wrote:

I've looked at learning gtk a number of times.  I have C expereince and
always get real excited about it before finding myself involved with
something else prior to getting anything done.

I have a project I'm working on which I hope to use gtk on.  I have 3
gtk/gnome books now. But there is this nagging line of code in one of the
examples in the New Riders book by Eric Harlow.

The example has the following gtk_signal_connect function call

gtk_signal_connect(GTK_OBJECT(window), "delete_event",
GTK_SIGNAL_FUNC(destroy), NULL);

This is on line 36 of the book.  THis looks like an error.  There is know
destroy function defined in the example and it is flaged by the compiler.

There is a gint CloseAppWindow function defined, but it is  not being used.

This is an error --- right?


IT is a user defined function for closing the App down.  You can name
the function anything you want.  He has already defined what the
function does in other examples so he doesn't put it in the other
programs over and over again and thus waste space.  He does that
throughout the book (he says to refer to previous code so he doesn't
have to include it again and waste space).  Take a look at the
CloseAppWindow function. It will do the same thing as 'destroy' but
remember if you create a function called CloseAppWindow you have to
change the GTK_SIGNAL_FUNC(destroy) line to
GTK_SIGNAL_FUNC(CloseAppWindow).

All the function will do is call gtk_main_quit() and return a (FALSE);

that's all.




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