Page 1 of 1
Dismissing answer dialogs after xxx seconds automatically
Posted: Wed Nov 06, 2013 6:50 pm
by andyh1234
If there any way to automatically dismiss an answer dialog box after xxx seconds.
I realise I can create a separate stack / card and show it, then have it dismiss itself after xxx seconds, but it seems like I would have to add lots of extra code to get the custom stack to show in a viable place, resize itself to the contents of the message etc etc and I'm just wondering if its possible at all to add code to have the existing answer dialog box close without user input.
Re: Dismissing answer dialogs after xxx seconds automaticall
Posted: Wed Nov 06, 2013 7:12 pm
by Klaus
Hi Andy,
just created a button with this script and it worked
Code: Select all
on mouseUp
## Important part to send BEFORE the dialog ;-)
send "closeit" to me in 2 secs
answer "sfasdfasdfasdfasdf"
end mouseUp
command closeit
close stack "Answer Dialog"
end closeit
You get the picture!
Best
Klaus
Re: Dismissing answer dialogs after xxx seconds automaticall
Posted: Wed Nov 06, 2013 7:29 pm
by andyh1234
Thanks Klaus!
Re: Dismissing answer dialogs after xxx seconds automaticall
Posted: Wed Nov 06, 2013 10:08 pm
by dunbarx
Klaus.
Nice.
I love the fact that everything in LC is a stack. Try doing that in HC.
Craig
Re: Dismissing answer dialogs after xxx seconds automaticall
Posted: Fri Apr 19, 2019 8:08 pm
by MWCoastMedia
Klaus wrote: ↑Wed Nov 06, 2013 7:12 pm
Code: Select all
on mouseUp
## Important part to send BEFORE the dialog ;-)
send "closeit" to me in 2 secs
answer "sfasdfasdfasdfasdf"
end mouseUp
command closeit
close stack "Answer Dialog"
end closeit
When attempting this on iOS, Livecode throws error codes 91 (chunk: can't find stack) and 108 (close: can't find stack).
Since there is only 1 stack when deploying to mobile, is the only option for something like this to create your own modal rather than using the "answer" command?
Re: Dismissing answer dialogs after xxx seconds automatically
Posted: Fri Apr 19, 2019 8:52 pm
by SparkOut
You might see if "toast" widgets are a possible option for mobile?
Re: Dismissing answer dialogs after xxx seconds automatically
Posted: Sat Apr 20, 2019 9:03 am
by [-hh]
You could also have a look on AlertBuilder, works in LC 6/7/8/9.
See the description here
viewtopic.php?p=143920#p143920
and/or download from (sorry, currently not available)
Re: Dismissing answer dialogs after xxx seconds automatically
Posted: Sat Apr 20, 2019 9:33 am
by SparkOut
I might have known to suggest checking one of Hermann's nifty stacks first!
Vielen Dank wieder, [-hh]
Re: Dismissing answer dialogs after xxx seconds automaticall
Posted: Sat Apr 20, 2019 1:26 pm
by Klaus
Hi MWCoastMedia,
MWCoastMedia wrote: ↑Fri Apr 19, 2019 8:08 pm
Klaus wrote: ↑Wed Nov 06, 2013 7:12 pm
Code: Select all
on mouseUp
## Important part to send BEFORE the dialog ;-)
send "closeit" to me in 2 secs
answer "sfasdfasdfasdfasdf"
end mouseUp
command closeit
close stack "Answer Dialog"
end closeit
When attempting this on iOS, Livecode throws error codes 91 (chunk: can't find stack) and 108 (close: can't find stack).
Since there is only 1 stack when deploying to mobile, is the only option for something like this to create your own modal rather than using the "answer" command?
You are six years late for the party!
On the desktop/standalones and in the IDE the ASK and ANSWER dialogs are in fact STACKS, but not on mobile!
Here the underlying OS supplies the dialogs and we cannot control them from within LC.
I would create a GROUP which covers the complete card to FAKE an answer dialog, know what I mean?
Best
Klaus