Page 1 of 1
Ask to Save
Posted: Wed Feb 24, 2016 4:08 pm
by lohill
While working in the IDE, what is it that causes the message "Do you want to save changes to stack "XXX" and all other stacks in the file "XXX" before closing?". Some stacks always ask even when you have done nothing to them. Is there a way I can force that to be quiet? I have a stack that I often open because it contains cards with code samples. The stack doesn't even have open and close scripts. If I just open it and then close it I get asked if I want to save.
Thanks,
Larry
Re: Ask to Save
Posted: Wed Feb 24, 2016 4:22 pm
by dunbarx
Hi.
Trap the "saveStackRequest" message in the stack script. The save will not take place unless this message makes it to the engine.
Craig Newman
EDIT.
Hmmm. This does not actually prevent the dialog, only prevents saving.
Re: Ask to Save
Posted: Wed Feb 24, 2016 4:43 pm
by dunbarx
Well, here is a kluge.
In the stack script, in an "openStack" handler:
Code: Select all
on openStack
save this stack
end openStack
This will save the stack automatically each time you open it. But it costs you nothing, especially if you close your eyes. and if you really do not do anything but navigate the stack will not try to save yet again.
Craig
Re: Ask to Save
Posted: Wed Feb 24, 2016 6:06 pm
by lohill
Thanks Craig - the 'save' works like a charm. I'm OK with kluges, I just thought there would be something more elegant. Does this problem ever happen to anyone else? I see it every once in a while.
Larry
Re: Ask to Save
Posted: Wed Feb 24, 2016 6:14 pm
by Thierry
lohill wrote:
I just thought there would be something more elegant.
Larry
Larry,
You might look at setting your stack as a plugin...
Thierry
Re: Ask to Save
Posted: Thu Feb 25, 2016 2:48 am
by lohill
Thanks Thierry,
I had never tried that before but I made it a user plug-in and it does just what I want.
Larry