[NTLK] Solved: NewtonScript question: How to restart the Application from within the application

NewtonTalk newtontalk at pda-soft.de
Mon Mar 14 13:22:57 PDT 2022


To answer my own question: Closing and reopening a Newton program, in other
words restarting it, from within the program can be done like this:

     AddDeferredCall (func() getRoot().(kAppSymbol):close(), '[]);
     AddDelayedCall (func() getRoot().(kAppSymbol):open(), '[], 2000);

AddDeferredCall queues the close() call to execute the next time the system
main event loop is executed.

AddDelayedCall schedules the open() call to execute after a specific delay,
in this case two seconds.

I wonder why NewtonScript developers are required to search the available
documentation for anything but "restart()" if they want to restart
something. Good that one of my senile brain cells just remembered having
read about these methods two decades ago. Hgrmpfff...

Frank

-- Newton software and hardware at http://www.pda-soft.de




Hi gang,

in order for a language change to take effect, NewtTest needs to be closed
and reopened. It's pretty easy to close it programmatically as follows:

     getRoot().(kAppSymbol):close();

But it would be cool if there was a way to reopen it automatically once it
has been closed. Of course this could be done via

     getRoot().(kAppSymbol):open();

but NewtTest can't do this because it is currently closed. So I'd need a way
for NewtTest to tell getRoot() to not only close it, but to reopen it
afterwards. 

I've been perusing the usual Newton programming documentation, but didn't
find anything. Which isn't overly surprising, since I'm an expert in not
finding NewtonScript-related information...

Any ideas?

Thanks

Frank

-- Newton software and hardware at http://www.pda-soft.de




More information about the NewtonTalk mailing list