Temporary Answer Dialoge

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Temporary Answer Dialoge

Post by ghettocottage » Thu Nov 10, 2016 6:59 am

I know this is possible, but I cannot find any threads on it, and the search words I am using are so ubiquitous that I am not even close to finding an answer:

Can I have an answer box pop up and then close after a few seconds. Bonus points if it sort of fades out.

my code:

Code: Select all

      
      if tData is "No Results" then
      answer tData
      end if
Just to be sure, I went ahead and tried this, but it did not work:

Code: Select all

      
      if tData is "No Results" then
      answer tData close after 3 seconds then fade
      end if

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Temporary Answer Dialoge

Post by shaosean » Thu Nov 10, 2016 8:02 am

i don't know about the fade, but you can probably do something like this for the dialog to close after a few seconds..

Code: Select all

if tData is "No Results" then
      answer tData
      send "closeAnswer" to me in 3 seconds
end if

on closeAnswer
      if ("answer" is among the lines of the openStacks) then
            close stack "answer"
      end if
end closeAnswer
I don't have LiveCode installed, so not 100% certain what the name of the answer stack is (I believe it is just answer though).. You may also want to do a check to see if

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Temporary Answer Dialoge

Post by Klaus » Thu Nov 10, 2016 1:06 pm

Hi Sean,
shaosean wrote:...You may also want to do a check to see if
yes? Come on, try it! 8)

@ghettocottage
I really would reverse the commands here:

Code: Select all

...
if tData is "No Results" then
      ## answer tData
      send "closeAnswer" to me in 3 seconds
      answer tData
end if
...
And then you could add a repeat loop in the "closeAnswer" handler to slowly fade out
the stack by setting its BLENDLEVEL.


Best

Klaus

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Temporary Answer Dialoge

Post by [-hh] » Thu Nov 10, 2016 1:55 pm

was a bit complicated :-)
Last edited by [-hh] on Thu Nov 10, 2016 9:50 pm, edited 1 time in total.
shiftLock happens

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Temporary Answer Dialoge

Post by dunbarx » Thu Nov 10, 2016 3:22 pm

All good stuff. But I wonder if in this case the simplest method is to make your own small dialog stack, and use visual effects.

Craig

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Temporary Answer Dialoge

Post by [-hh] » Thu Nov 10, 2016 7:14 pm

was a bit complicated :-)
Last edited by [-hh] on Thu Nov 10, 2016 9:49 pm, edited 1 time in total.
shiftLock happens

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Temporary Answer Dialoge

Post by ghettocottage » Thu Nov 10, 2016 7:58 pm

dunbarx wrote:All good stuff. But I wonder if in this case the simplest method is to make your own small dialog stack, and use visual effects.

Craig
Thanks for the different ideas for this. Craig's thought was indeed the simplest and most flexible. I just created a sub stack with a field in it for messages and wrote a little function to show/hide it with whatever message I want.

Post Reply