Page 1 of 1

"Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 2:34 pm
by Simon Knight
Well the title says it all.

If the stack is just closed from the menu then "closestack message" is sent but if the "Close and Remove from Memory" is used it is not.

I'm on a Mac by the way.

Why is this?

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 3:25 pm
by dunbarx
If I have both a closeStack and a closeStackRequest handler in the stack script:

Code: Select all

on closeStack
   answer random(999)
end closeStack


on closeStackRequest
   answer any char of "ASDFG"
   pass closeStackRequest
end closeStackRequest
Only "closeStack" fires from the "close" menuitem.
Both fire if I close from the close box.
Neither fires from the "close and remove from memory" menuItem

Craig

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 3:30 pm
by dunbarx
I cannot understand why neither message is sent with the ""close and remove from memory" selection. In fact, nothing appears in the message watcher with that menuItem. LC obviously closes down really fast and really early when this is the selected way out.

Craig

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 4:37 pm
by FourthWorld
dunbarx wrote:
Mon Apr 01, 2024 3:25 pm
If I have both a closeStack and a closeStackRequest handler in the stack script:

Code: Select all

on closeStack
   answer random(999)
end closeStack


on closeStackRequest
   answer any char of "ASDFG"
   pass closeStackRequest
end closeStackRequest
Only "closeStack" fires from the "close" menuitem.
Both fire if I close from the close box.
Neither fires from the "close and remove from memory" menuItem

Craig
So you get the messages when you close the stack from your own menu after selecting "Suspend IDE"?

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 8:27 pm
by dunbarx
Richard.

Nobody ever mentioned suspending the IDE. Simon just wondered why using the "close and remove from memory" menuItem no messages are sent.

Craig

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 8:29 pm
by dunbarx
Richard.

Did you mean "suspend development tools"? I never heard of suspending the IDE.

Craig

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Mon Apr 01, 2024 11:18 pm
by FourthWorld
dunbarx wrote:
Mon Apr 01, 2024 8:29 pm
Richard.

Did you mean "suspend development tools"? I never heard of suspending the IDE.
Yes, suspending. How does that affect what you're experiencing?

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Tue Apr 02, 2024 9:52 am
by Simon Knight
Good morning, I have just checked and "suspend development tools" removes all options to close the application under development. Quitting Livecode even fails so its a dead end and I have no idea why it is an option; probably a good idea at the time.

S

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Tue Apr 02, 2024 4:21 pm
by FourthWorld
Simon Knight wrote:
Tue Apr 02, 2024 9:52 am
Good morning, I have just checked and "suspend development tools" removes all options to close the application under development. Quitting Livecode even fails so its a dead end and I have no idea why it is an option; probably a good idea at the time.
The goal with suspending the IDE is to provide an environment that more closely matches runtime. This can be useful to testing some things, esp menus or things that really on messages the IDE traps, like the pointer tool.

When you'd quit during suspension, what code did your interface use to do so?

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Tue Apr 02, 2024 8:38 pm
by stam
Simon Knight wrote:
Tue Apr 02, 2024 9:52 am
Good morning, I have just checked and "suspend development tools" removes all options to close the application under development. Quitting Livecode even fails so its a dead end and I have no idea why it is an option; probably a good idea at the time.

S
It is needed but as far as I know, rarely. Things like pasteKey need this for testing (basically approximating a standalone runtime).
The LiveCode development environment traps the pasteKey message, unless "Suspend LiveCode UI" is turned on in the Development menu. This means that the pasteKey message is not received by a stack if it's running in the development environment.

Re: "Close and Remove from Memory" does not call CloseStack

Posted: Tue Apr 02, 2024 9:28 pm
by Simon Knight
When you'd quit during suspension, what code did your interface use to do so?

Code: Select all

On CloseStack
   WriteAppPrefsData
   
end CloseStack
Called when the red close window icon is pressed and the prefs are updated.

S