How to dismiss a modal dialog (was: Re: Ask & Answer)
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Sun May 27 11:14:39 EDT 2007
Hi Joe,
Le 27 mai 07 à 17:01, LunchnMeets at aol.com a écrit :
> OK, so I’ve created a modal stack that ignores everything else.
> That’s good.
> Now how do I transfer data from that modal stack to the continuing
> script
> that opened the modal stack? Maybe dialogData has something to do
> with that but I
> don’t understand that command.
DialogData is not a command but a property that can be considered as
a global property since you may change its contents from any script.
For instance:
put "OK" into tBtn1
put "Cancel" into tBtn2
put "Are we going to the cellar?" into tPrompt
set the dialogData to tBtn1 & cr & tBtn2 & cr & tPrompt
modal stack "MyAsnwer" -- this will trigger preOpenStack in MyAnwser:
see below
if the dialogData then doAction -- see btn scripts below that have
changed the contents of the dialogData in the meantime :-)
etc.
on preOpenStack
set the label of btn "OK" to line 1 of the dialogData
set the label of btn "Cancel" to line 2 of the dialogData
put line 3 of the dialogData into fld "Prompt"
-- your dialog is now customized
etc.
on mouseUp -- btn "Cancel"
set the dialogData to false
close this stack
end mouseUp
on mouseUp -- btn "OK"
set the dialogData to true
close this stack
end mouseUp
Hope this helps
Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
http://www.sosmartsoftware.com/
eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------
More information about the use-livecode
mailing list