> > Since gnucash doesn't seem to be explicitly destroying the
> > main window anywhere, I would have thought that this scenario
> > would be impossible.
>
> You're right, it should be impossible. However, if a bug causes the
> main window to exit, then the program should exit gracefully as the
> current design of gnucash-gnome depends on the main window being open.
Yeah, that's a good point. As for how we should shut down,
see my points below.
> Here you're also right, I was mistaken. I played with it tonight, and
> gtk_main_quit() does indeed return to the calling procedure. However,
> gnc_shutdown() does not exit the program. It just initiates a series of
I'm still not convinced of this. Here's how gnc_shutdown
appears to work to me:
1. Get a 'pointer' to the scheme gnc:shutdown code.
2. Evaluate that code.
The scheme shutdown code (src/scm/main.scm) then does the following:
1. Run any shutdown hooks that have been registered.
2. Run _gnc_shutdown which does the "do you want to save" thing.
Note that the user can choose to save or not save at this point,
but not to abort the shutdown.
The last thing _gnc_shutdown does is gtk_main_quit()
3. The last thing the scheme shutdown code does is invoke
the scheme function 'exit', which I believe is a
full-blown exit. Try putting a printf after the
invocation of the scheme shutdown code in gnc_shutdown()
or right after the gtk_main() invocation. When I do it,
there is no output.
I think we should shutdown scheme after we exit gtk_main.
Or, more generally, we should shutdown scheme after we
shutdown the ui, since the ui is started after scheme.
Thus, when we get a delete_event on the main window,
or the File/Quit is selected, etc., I think we should:
1. Do the "do you want to save thing", etc.
2. gtk_main_quit().
Then, when gtk_main() falls out, we shut down scheme.
Of course, this would also affect how things are done
on the Motif side as well.
comments?
dave
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]