"Close and Remove from Memory" does not call CloseStack

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

"Close and Remove from Memory" does not call CloseStack

Post by Simon Knight » Mon Apr 01, 2024 2:34 pm

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?
best wishes
Skids

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » 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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Mon Apr 01, 2024 3:30 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

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

Post by FourthWorld » Mon Apr 01, 2024 4:37 pm

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"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Mon Apr 01, 2024 8:27 pm

Richard.

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

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Mon Apr 01, 2024 8:29 pm

Richard.

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

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

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

Post by FourthWorld » Mon Apr 01, 2024 11:18 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

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

Post by Simon Knight » 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
best wishes
Skids

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

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

Post by FourthWorld » Tue Apr 02, 2024 4:21 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2688
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

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

Post by stam » Tue Apr 02, 2024 8:38 pm

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.

Simon Knight
Posts: 854
Joined: Wed Nov 04, 2009 11:41 am
Location: Gunthorpe, North Lincs, UK

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

Post by Simon Knight » Tue Apr 02, 2024 9:28 pm

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
best wishes
Skids

Post Reply

Return to “Talking LiveCode”