Close Stack Cleanup
bobsneidar at iotecdigital.com
Thu Feb 4 18:10:11 EST 2021
Thanks for the reply Jacque. I ran the message watcher while clicking the red dot. None of the messages that appear have anything to do with closing the stack.
Here’s what I came up with. The closeStackRequest is NOT getting sent to the current card as the dictionary indicates, although the target IS the current card. It DOES get sent to the stack though. So I put this in the stack script and it DOES work with the red dot.
if the short name of the target is "Main” then — I have substacks but no other cards called Main
dispatch resetMainForm to the target
save this stack
On Feb 4, 2021, at 2:52 PM, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>> wrote:
There used to be a gREV* global variable that tracked the dirty status and if the stack was dirty it put up the "do you want to save?" dialog. I can't find it now so something has changed. When it existed, you could toggle that variable via script and the IDE wouldn't bother you.
The IDE does pass the closeStackRequest to your stack after it checks the stack status. The docs are correct that you don't get that message when a script closes the stack but you can use closeStack instead; however, first we need to find out where that variable went to. It used to be in the globals pane of the message watcher, and I'd recognize it if I saw it, but I can't remember now what it was.
More information about the use-livecode