> 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?

Since gnucash doesn't seem to be explicitly destroying the
main window anywhere, I would have thought that this scenario
would be impossible.
 
> >
> > 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().

As I understand the main loop operation, gtk_main_quit() just
unsets a 'running' flag. I thought we still needed to let the
main loop fall out of the gtk_main() call.

dave

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]

Reply via email to