Search For Improved Splash Standalone
Posted: Thu Jul 20, 2017 8:13 pm
Thanks to Dunbarx and Bogs for examples of an uncompiled Splash stack and Working stack on another thread. I've been experimenting with improvements.
I was hoping to use an on startup handler but I couldn't get it to work. I was surprised that the Splash.exe is not in the message pathway of the Working stack, so I tried to add it to the stacksInUse with start using, but that failed. The Working stack still has to be modified with save routines, or maybe a library stack with the saves could be added to the stacksInUse, but I didn't try that. I was unaware that a closed Splash.exe remains in memory even if its destroyStack prop is true, as long as it has at least one other stack (Working stack) added to the build. Testing for environment() allows easier editing in the IDE. If user renames Splash it still works, if user renames Working or moves it from Splash folder it quits.
Does anyone have an alternate route for a Splash strategy standalone?
This is what I came up with. Terry
I was hoping to use an on startup handler but I couldn't get it to work. I was surprised that the Splash.exe is not in the message pathway of the Working stack, so I tried to add it to the stacksInUse with start using, but that failed. The Working stack still has to be modified with save routines, or maybe a library stack with the saves could be added to the stacksInUse, but I didn't try that. I was unaware that a closed Splash.exe remains in memory even if its destroyStack prop is true, as long as it has at least one other stack (Working stack) added to the build. Testing for environment() allows easier editing in the IDE. If user renames Splash it still works, if user renames Working or moves it from Splash folder it quits.
Does anyone have an alternate route for a Splash strategy standalone?
This is what I came up with. Terry
Code: Select all
--For Splash Standalone Stack Script:
--1) include working stack in the build: file > standalone app settings > stacks, add stack file. Choose platform(s).
--2) compile splash stack: file > save as standalone app.
on preOpenStack
if environment() contains "standalone" then
close this stack --splash's LC engine remains in memory even if destroyStack prop is true, if other stacks are in the build
if there is a stack "Working" then --<-ENTER YOUR WORKING STACK NAME
open stack "Working" --<-ENTER YOUR WORKING STACK NAME
set the loc of this stack to screenLoc() --center
else quit --remove splash from memory
end if
pass preOpenStack
end preOpenStack
--For Working Stack Stack Script:
on closeStack
if environment() contains "standalone" then save this stack --auto save
pass closeStack
end closeStack
on commandKeyDown pKey
if environment() contains "standalone" and pKey = "s" then save this stack --save
else pass commandKeyDown
end commandKeyDown