Close the stack and don't ask me to save changes...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Close the stack and don't ask me to save changes...
Hi...
I have a stack that runs just fine... I open the stack in the IDE and use it, Ok... no problems.. but, when I have finished using the stack it always pops up the 'Do you want to savechanges to stack "xxx"...
How do I get to close or quit the stack so that this dialog never appears... in that I don't want changes making to the stack, but I don't wish to be asked the question... I can't work it out ?
confused
Dixie
I have a stack that runs just fine... I open the stack in the IDE and use it, Ok... no problems.. but, when I have finished using the stack it always pops up the 'Do you want to savechanges to stack "xxx"...
How do I get to close or quit the stack so that this dialog never appears... in that I don't want changes making to the stack, but I don't wish to be asked the question... I can't work it out ?
confused
Dixie
-
- VIP Livecode Opensource Backer
- Posts: 9756
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Close the stack and don't ask me to save changes...
Check out the "saveStackRequest" message in the dictionary. Untested, but closing the stack with a "close stack" command and trapping this message will likely do what you want.
Or at least give you a start.
Craig Newman
Or at least give you a start.
Craig Newman
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: Close the stack and don't ask me to save changes...
Craig...
Thanks.. I had used the 'saveStackReques't but found it not to work... I don't know what I was doing with it, but whatever it was didn't help... anyway after getting your reply, I went back to it ... then read the dictionary listing again and now all is well... thanks !
be well
Dixie
Thanks.. I had used the 'saveStackReques't but found it not to work... I don't know what I was doing with it, but whatever it was didn't help... anyway after getting your reply, I went back to it ... then read the dictionary listing again and now all is well... thanks !
be well
Dixie
Re: Close the stack and don't ask me to save changes...
Hi,
That's right, messages like saveStackRequest, closeStackRequest and shutDownRequest are sent to the IDE first. Worse, the IDE sends a message to a field in the topstack, thereby changing the variable gRevstackStatus[name of stack] and hence causing LC to ask you whether to change the stack or not.
There are still ways to do this. You can set the cantModify of your stack to true or open your stack as a modeless window.
Best,
Mark
That's right, messages like saveStackRequest, closeStackRequest and shutDownRequest are sent to the IDE first. Worse, the IDE sends a message to a field in the topstack, thereby changing the variable gRevstackStatus[name of stack] and hence causing LC to ask you whether to change the stack or not.
There are still ways to do this. You can set the cantModify of your stack to true or open your stack as a modeless window.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Close the stack and don't ask me to save changes...
Hello,
14 years later with LC 9.6.11, I still have this problem!
If we lock the stack by setting its cantModify property to true, we do not have this annoying Save dialog when closing the stack but we cannot paste text into a field.
I tried to look at how the built-in revSearch stack was made but I didn't find anything special: it is in topLevel (like an ordinary stack) and I didn't find anything that sets its "cantModify" property to true.
Any ideas ?
14 years later with LC 9.6.11, I still have this problem!
If we lock the stack by setting its cantModify property to true, we do not have this annoying Save dialog when closing the stack but we cannot paste text into a field.
I tried to look at how the built-in revSearch stack was made but I didn't find anything special: it is in topLevel (like an ordinary stack) and I didn't find anything that sets its "cantModify" property to true.
Any ideas ?
Re: Close the stack and don't ask me to save changes...
Did you try:
?
Code: Select all
...
lock messages
close this stack
## or any other stack
...
Re: Close the stack and don't ask me to save changes...
Yep Klaus, without success.Klaus wrote: ↑Mon Feb 05, 2024 1:40 pmDid you try:?Code: Select all
... lock messages close this stack ## or any other stack ...
Re: Close the stack and don't ask me to save changes...
Hm, just made a test and that little script works for me, new stack with a field and a button,
no dialog after clicking, but I see this dialog when I use the red close button on my Mac.
When exactly do you see that dialog and what did you script so far?
no dialog after clicking, but I see this dialog when I use the red close button on my Mac.
When exactly do you see that dialog and what did you script so far?
Re: Close the stack and don't ask me to save changes...
We are agree: closing a stack in the IDE by script is OK. The problem is when closing the stack with the "red close" button.
Though, the revSearch stack has a default look, so it has a "red close" button but clicking on it doesn't trigger this annoying Save dialog.
Re: Close the stack and don't ask me to save changes...
You raise an interesting question - how does the revSearch do this? As far as I can tell it behaves like a modeless stack, but reports being topLevel and like you looking at the card and stack script I cannot fathom how this is done...Zax wrote: ↑Mon Feb 05, 2024 11:17 amIf we lock the stack by setting its cantModify property to true, we do not have this annoying Save dialog when closing the stack but we cannot paste text into a field.
I tried to look at how the built-in revSearch stack was made but I didn't find anything special: it is in topLevel (like an ordinary stack) and I didn't find anything that sets its "cantModify" property to true.
Having said that, you can achieve this exact behaviour by setting the style of your stack to "modeless".
It will appear and behave like a normal topLevel stack, but can't be modified and will close without asking to be saved. Pretty much the same as a palette will do.
Isn't this what you are trying to achieve? (instead of 'dialog box' read 'stack' in the quote above)Dictionary wrote:A modeless dialog box behaves like an ordinary window, except that it cannot be edited. Use modeless dialog boxes to ask the user for information.
To edit a modeless dialog box, use the topLevel command to display it in an editable window.
Stam
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Close the stack and don't ask me to save changes...
LC sets a flag on a stack whenever any change happens, and if it's true then you get the dialog. The problem is that LC automatically places the insertion point in the first unlocked field when the card opens and that counts as a change whether you type anything or not. I submitted a bug report requesting a change to the behavior but so far no action on that.
LC does not apply the same rules to IDE stacks which is why the search stack doesn't show a dialog. If I remember right, LC traps the closeStackRequest message in a front script before passing it on to the stack, which is why it's difficult to avoid it.
LC does not apply the same rules to IDE stacks which is why the search stack doesn't show a dialog. If I remember right, LC traps the closeStackRequest message in a front script before passing it on to the stack, which is why it's difficult to avoid it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Close the stack and don't ask me to save changes...
Thanks Jacque, nice to know!
I believe a “modeless” stack probably fulfils the above request having said all that….
I believe a “modeless” stack probably fulfils the above request having said all that….
Re: Close the stack and don't ask me to save changes...
Thank you Jacqueline for your explanations.
And thank you Stam: a modeless stack seems to be a good solution.
Now, I think LC is not very clear/convenient on this point:
- if a topLevel stack is set as cantModify, a "normal" (editable) field can be filled by typing manually in it but text can't be pasted. Worse, a save dialog appears when closing such a stack.
- to have a real "cantModify" stack, you have to set its style to modeless.
Concerning the "autoFocus" on first editable field when opening a card, it's very annoying since years. It should be a stack property in order to choose its behavior.
And thank you Stam: a modeless stack seems to be a good solution.
Now, I think LC is not very clear/convenient on this point:
- if a topLevel stack is set as cantModify, a "normal" (editable) field can be filled by typing manually in it but text can't be pasted. Worse, a save dialog appears when closing such a stack.
- to have a real "cantModify" stack, you have to set its style to modeless.
Concerning the "autoFocus" on first editable field when opening a card, it's very annoying since years. It should be a stack property in order to choose its behavior.
-
- VIP Livecode Opensource Backer
- Posts: 7258
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Close the stack and don't ask me to save changes...
Feel free to complain here, maybe they'll notice:
https://quality.livecode.com/show_bug.cgi?id=22790
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Close the stack and don't ask me to save changes...
Done.jacque wrote: ↑Tue Feb 06, 2024 6:56 pmFeel free to complain here, maybe they'll notice:
https://quality.livecode.com/show_bug.cgi?id=22790