(Rev 2.8.1) resume and defaultstack

Russell Martin russell_martin at yahoo.com
Fri Feb 15 02:53:32 EST 2008


When using an answer dialog from within a resume handler, the
defaultstack becomes "answer dialog", yet, when using an answer dialog
in other handlers, the defaultstack does NOT become "answer dialog".

I've tested this in both OS X and Windows XP and it does it in both.

Is this a bug?

I've attempted to attache a file demonstrating this. Must build as
standalone first (I can't get "on resume" to fire from within the IDE-
is there a way?)

If the attachment doesn't come through, or you don't want to download
it, here's how to recreate this:
Create a new main stack.

Place a scrolling field on it and name it "ResultsField"

Name the card "TheCard"

Name the stack "Untitled 2"

Place a button on the stack.

Inside the mouseUp handler for the button, place the following code:
put "the defaultstack is: " & the defaultstack & cr into field
"ResultsField" of card "TheCard" of stack "Untitled 2"
  answer "Yes or no?" with "Yes" or "No"
  put "it was: " & it & cr after field "ResultsField" of card "TheCard"
of stack "Untitled 2"
  put "the defaultstack is: " & the defaultstack & cr after field
"ResultsField" of card "TheCard" of stack "Untitled 2"
  answer "Up or down?" with "Up" or "Down"
  put "it was: " & it & cr after field "ResultsField" of card "TheCard"
of stack "Untitled 2"
  put "the defaultstack is: " & the defaultstack & cr after field
"ResultsField" of card "TheCard" of stack "Untitled 2"

In the stack script, create and "on resume" handler and place the exact
same code as you did in the button's "on mouseUp" handler.

Build a stand alone.

Run the stand alone.

When you click on the button, and answer the dialogs, the ResultsField
will show the default stack as being "Untitled 2" every time.

However, when you switch to another app and then switch back to
Untitled 2, the defaultstack will be "answer dialog" every time.



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


More information about the use-livecode mailing list