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.

on closeStackRequest
   if the short name of the target is "Main” then — I have substacks but no 
other cards called Main
      dispatch resetMainForm to the target
   end if

   save this stack
   pass closeStackRequest
END closeStackRequest

Bob S


On Feb 4, 2021, at 2:52 PM, J. Landman Gay via use-livecode 
<use-livecode@lists.runrev.com<mailto:use-livecode@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.

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to