Hi!
New basic question:
I have a main stack and a substack and I want the app to quit if I clic on the X of the main stack and to just close the substack if I clic on its X.
If I put his code on the main stack:
on closeStack
quit
end closeStack
and this code on the other substacks:
on closeStack
end closeStack
it works fine, but I was wondering if there is a better way to reach the same goal!
Thank you, Davide
Quit an app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Quit an app
Would something like this work? Just put it into the main stack script, and i think it will do what you're asking.
Not sure if that's the best way to go about it, but maybe it's what you're looking for.
edit: removed the line that replaced space with empty, as this would mess things up if there was a space in your stack titles
Code: Select all
on closestackrequest
put the owner of the target into tStackTitle
set the itemdelimiter to space
delete item 1 of tStackTitle
replace quote with empty in tStackTitle
if tStackTitle is "MyMainStack" then
quit
else
close stack tStackTitle
end if
end closestackrequest
Not sure if that's the best way to go about it, but maybe it's what you're looking for.
edit: removed the line that replaced space with empty, as this would mess things up if there was a space in your stack titles
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Quit an app
As a matter of fact, maybe this one is a little better.
Code: Select all
on closestackrequest
put the short name of the owner of the target into tStackTitle
if tStackTitle is "MyMainStack" then
quit
else
close stack tStackTitle
end if
end closestackrequest
Re: Quit an app
Hi to all,
I want to thank you sefrojonesGAda40, because I had the same question than D4vidrim and your last example is exactly what I needed
Great forum !
Cheers, Jean-Paul.
I want to thank you sefrojonesGAda40, because I had the same question than D4vidrim and your last example is exactly what I needed

Great forum !
Cheers, Jean-Paul.
Discovering LiveCode Community 6.5.2.
Re: Quit an app
it works very well, thanks!