close/quit function

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
Anya
Posts: 5
Joined: Tue Feb 04, 2020 5:33 am

close/quit function

Post by Anya » Wed Feb 12, 2020 12:28 am

I'm trying to make a close and quit option on a floating menu that can act upon any/all open stacks. this involves a popup asking are you sure you want to (close/quit) and yes/no buttons that can close the stack that I had on top or quit all stacks. I've been able to get quit to work, but because close is so specific in what it is trying to act upon - the last opened stack which is not the popup (where the popup is the window with the button on it, and is also the top window/stack) it's a lot more difficult to get working. Is there a simple solution, or would I have to include something like "if stack xxx is open then close stack xxx" so, the long way.

I've looked through the dictionary and it seems like there isn't anything specific enough or anything that works within the context I need.

e. g. mainwindow open and substack1 open, substack2 and 3 not open but in existence. Close popup opens and button on popup must act on substack1, but also be able to act on substack 2 and/or 3 if open.

is there a command/etc. that works on the prior opened stack (e. g. not the popup, which is the current window)

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

Re: close/quit function

Post by FourthWorld » Wed Feb 12, 2020 2:30 am

It sounds like what you're looking for is the topstack function:
https://livecode.com/resources/api/#liv ... t/topstack
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: close/quit function

Post by mwieder » Thu Jul 21, 2022 11:54 pm

<sigh> Note that the LiveCode website no longer responds to REST calls that way.
You have to go to https://livecode.com/resources/api/ and type "topstack" into the search bar.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: close/quit function

Post by richmond62 » Fri Jul 22, 2022 8:33 am

How about typing 'topstack' into the Dictionary?
-
SShot 2022-07-22 at 10.39.45.png
-
SShot 2022-07-22 at 10.50.45.png
-
Here's something to play with. 8)
Attachments
RED.livecode.zip
Stack.
(1.01 KiB) Downloaded 108 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: close/quit function

Post by richmond62 » Fri Jul 22, 2022 9:12 am

Oooooer . . . did not realise this thread has been sitting around for 2 years with nothing happening. :?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: close/quit function

Post by richmond62 » Fri Jul 22, 2022 9:30 am

I was reading the bit in the Dictionary about destroyStack and
could NOT find what the default situation was.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: close/quit function

Post by bn » Fri Jul 22, 2022 9:34 am

richmond62 wrote:
Fri Jul 22, 2022 9:30 am
I was reading the bit in the Dictionary about destroyStack and
could NOT find what the default situation was.
It is a preference.
Go to Preferences -> "Files & Memory" and choose your preferences for "DestroyStack"

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: close/quit function

Post by richmond62 » Fri Jul 22, 2022 12:06 pm

Thank you very much.
-
SShot 2022-07-22 at 15.15.51.png

Post Reply

Return to “LiveCode Builder”