Grant answered my questions in the message below,
but it seems he is having trouble posting to the
list, so here is his response.
------- Forwarded Message
Date: Wed, 13 Oct 1999 09:48:48 -0400
From: "Grant Likely" <[EMAIL PROTECTED]>
To: Dave Peticolas <[EMAIL PROTECTED]>
Subject: Re: *PATCH* (GNOME) Fix to handle delete window events
Dave Peticolas wrote:
>
> Is it really necessary to install a destroy callback?
> I though the default would suffice in this case.
>
Actually, the destroy callback is not needed at all. You'll notice that it
doesn't actually do anything, it just returns FALSE. The destroy callback
is called just before the main window widget is closed so you can do some
final cleanup. I thought I would need it, but I didn't, and I forgot to
remove it before creating the patch.
However, it might make sense to add a call to gtk_main_quit() in the destroy
event callback to make sure that the application exits when a destroy event
occurs without a delete event before it. Can somebody else elaborate on
this?
>
> Also, is it ok to shutdown the program without letting
> the gtk main loop finish?
>
The comment on the delete event callback is misleading. It should read:
/* return TRUE when gnc_shutdown(0) returns because we are only
* requesting to quit the program, and we don't want to close the window yet
*/
Delete events are on the window, not the application. If we returned FALSE,
then the window would close, but the gtk main loop would still be running,
and the program would have to be killed. calling gnc_shutdown(0) brings up
the "Do you want to save?" dialog box, and eventually calls gtk_main_quit().
>
> thanks,
> dave
Cheers,
G.
------- End of Forwarded Message
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]