octave-maintainers
[Top][All Lists]
Advanced

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

Re: What should file-save behavior be like at exit?


From: John W. Eaton
Subject: Re: What should file-save behavior be like at exit?
Date: Tue, 09 Apr 2013 19:13:31 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 04/09/2013 06:13 PM, Daniel J Sebald wrote:

Let's go back to this alternate approach I offered the other day. I'm
just trying to contrast the differences here and give alternatives or
perhaps lead to some enhanced callback approach. Say we have these routines

install_octave_command ()
corefeval ()

from the other day. At the beginning of the GUI/IDE application after
launching Octave thread, we could do:

install_octave_command ("exit", qt_exit_command);
install_octave_command ("quit", qt_exit_command);

and the GUI now has control over the exit and can determine exactly when
it wants to exit and use a similar if not the exact same exit process
for typing "quit" or "exit" at the command line or pressing the X
button. For example:

qt_exit_command (args)
{
// Make sure files are saved, everything is happy
ignore = some_object->go_through_shutdown_process ();
if (! ignore)
{
corefeval ("exit", varargs, etc.);
qApp->quit ();
}
}

Or something like that.

One problem that I see with this approach is that not every communication between the GUI and the interpreter is done by a built-in function. Or, code in the interpreter could bypass the built-in function to perform the same task, so the GUI would never be notified. For example, there could be calls to clean_up_and_exit instead of Fquit.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]