Reopen the stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Reopen the stack
How can I make the pile closed? He will ask "Do you want to close?" And if not then he will return the pile?
-
- Livecode Opensource Backer
- Posts: 9376
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Reopen the stack
One or 2 odd things here:
1. What do you mean by a 'pile'?
2. Isn't 'livecode' an odd user name?
Anyway, as far as I can understand from your posting let's imagine a button:
- -
and let's give it some code:
-
1. What do you mean by a 'pile'?
2. Isn't 'livecode' an odd user name?
Anyway, as far as I can understand from your posting let's imagine a button:
- -
and let's give it some code:
Code: Select all
on mouseUp
answer "Do you want to quit?" with "Yes" and "No"
if it is "Yes" then
quit
end if
end mouseUp
- Attachments
-
- QUITTER.livecode.zip
- Here's the stack.
- (804 Bytes) Downloaded 116 times
Re: Reopen the stack
I need it that if the answer is no, then LiveCode will go back to the stack
That is, when I close the app
That is, when I close the app
-
- Livecode Opensource Backer
- Posts: 9376
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Reopen the stack
Try my sample stack and see what happens when you select "No".
Re: Reopen the stack
Nothing happens but I need when exiting the app then it will go back in about such a code:
on closeStack
answer "exit?" with "no" and "yes"
if it is "no"
then
// Return to the app
end if
end closeStack
on closeStack
answer "exit?" with "no" and "yes"
if it is "no"
then
// Return to the app
end if
end closeStack
-
- Livecode Opensource Backer
- Posts: 9376
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Reopen the stack
That looks very odd to me, I suggest you try to work out how to do that by yourself.
-
- Livecode Opensource Backer
- Posts: 9376
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Reopen the stack
If there is nothing odd about it you shouldn't have to ask the question.
Re: Reopen the stack
Hi livecode,
welcome to the forum!
To learn more about the basics of Livecode, I recommend these stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
If the user wants to close a window via the button in the title bar, the -> closestackrequest
message is sent to LC. So just put this into the stackscript:
Best
Klaus
welcome to the forum!
To learn more about the basics of Livecode, I recommend these stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
If the user wants to close a window via the button in the title bar, the -> closestackrequest
message is sent to LC. So just put this into the stackscript:
Code: Select all
on closestackrequest
answer "Really close the stack?" with "no" and "yes"
if it = "yes" then
# we let the message pass, so LC will close the stack:
pass closestackrequest
end if
## No need to take action if user clicks "no", understand why?
end closestackrequest
Klaus
Re: Reopen the stack
I want this to happen when someone closes the app on the phone and then it asks if to exit or not
Re: Reopen the stack
When the user closes the app on the phone then even if he clicks "No"
Then it will close because the phone closes the app
Then it will close because the phone closes the app
Re: Reopen the stack
I am afraid we cannot do this on the mobile platform!
Because the user can use the hardware button on the phone and we cannot "trap" this.
Because the user can use the hardware button on the phone and we cannot "trap" this.
Re: Reopen the stack
It can be detected by on closeStack Was I wrong?
Re: Reopen the stack
No, but this does not work as expected on mobile, as you already experienced:
When the user closes the app on the phone then even if he clicks "No"
Then it will close because the phone closes the app
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Reopen the stack
The closeStack message is sent when the app is quitting. It allows you to do some things before it shuts down. For example, you can use that message to save user preferences to a file, or to reset controls on the card. But the message does not allow you to stop the shutdown because it is already happening.
If you have a Quit button you can control the shutdown by using Klaus' handler. But as he said, you can't control the hardware phone button behavior.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com