Standalone app as Frankensteinian Monster
Mark MacKenzie
m.mackenzie at sasktel.net
Thu Oct 26 09:47:52 EDT 2006
Hi. After a few month's work I am debugging the stand alone side of my
application. So far the app works really well and with a complacent
gleam in my mind's eye I click on the quit button of the main stack and
my application won't die! The program is in two parts really. There is
a Rev generated front end and an sqllite data base using the alt3sql
"dll" (licensed copy, my own).
After days of coding tweaks, etc. I think I need a refresher course in
scripting the shutting down and successful quitting of an application.
The application quits normally albeit a touch slowly as it saves various
stacks (only when in the development environment, stacks are not saved
except for a preferences stack which is outside the standalone in a set
of "extra files")
I have the following code in a closeStackRequest handler in my topmost
(main) application stack ( I have commented out various activities to
try and find the stoppage):
on closeStackRequest -- confirm whether to close the window
answer question "Are you sure you want to quit the entire program?"
with "Yes" or "No"
if it is "Yes"
then
if the environment is "development"
then
leavingDevelopment
pass closeStackRequest
end if
if the environment is "standalone application"
then
--quietDisconnectDB
--leavingApplication
-- quit
--close stack "Navigator"
KillAllPendingMessages
--pass closeStackRequest
quit
end if
end if
end closeStackRequest
on KillAllPendingMessages --courtesy of the list archives
repeat for each line i in the pendingMessages
cancel (item 1 of i)
end repeat
end KillAllPendingMessages
on leavingApplication
if "Navigator" is among the lines of the openStacks
then
close stack "Navigator"
end if
if "Bullets" is among the lines of the openStacks
then
close stack "Bullets"
end if
if "Attic" is among the lines of the openStacks
then
close stack "Attic"
end if
if "AboutStack" is among the lines of the openStacks
then
close stack "AboutStack"
end if
if "Calendar" is among the lines of the openStacks
then
close stack "Calendar"
end if
if "Primer" is among the lines of the openStacks
then
close stack "Primer"
end if
if "Suppliers" is among the lines of the openStacks
then
close stack "Suppliers"
end if
if "Brass" is among the lines of the openStacks
then
close stack "Brass"
end if
if "Propellant" is among the lines of the openStacks
then
close stack "Propellant"
end if
-- if "Loads" is among the lines of the openStacks
-- then
-- close stack "Loads"
--end if
if "Loads" is among the lines of the openStacks
then
close stack "Loads"
end if
if "Help" is among the lines of the openStacks
then
close stack "Help"
end if
save stack "ExtraFiles/ReloadingPrefs.rev"
if "ReloadingPrefs" is among the lines of the openStacks
then
close stack "ExtraFiles/ReloadingPrefs.rev"
end if
end leavingApplication
Any help, insight, pointers to working similar applications which do
evince a Frankensteinian lineage greatfully received.
Regards
Mark MacKenzie
Past Ink Publishing
More information about the use-livecode
mailing list