dialogData

Mark Schonewille m.schonewille at economy-x-talk.com
Fri Jul 25 14:41:33 EDT 2008


Hi Mike,

This is how it works:

-- some script calls someHandler with some parameter
on someHandler theSomeInfo
   set the dialogData to theSomeInfo
   go stack "My Dialog" as modal
   -- handler stops running until modal dialog closes
   put the dialogData into mySomeInfo
   -- now you can use the info store in mySomeInfo
   -- rest of script... for example...
   if mySomeInfo is true then
     -- do something
   else
     -- do nothing
   end if
end someHandler

-- handler in modal dialog
on preOpenStack
   -- set some default properties
   set the hilite of btn 2 to the cHiliteOfButton2 of me
   -- display the message
   -- (or set hilites of checkboxes etc)
   put line 1 of the dialogData into fld "Some Field"
   set the hilite of btn 1 to line 2 of the dialogData
   -- rest of script...
end preOpenStack

-- handler in OK button of modal dialog
on mouseUp
   set the cHiliteButton2 of me to the hilite of btn 2
   set the dialogData to true
   close this stack
end mouseUp

-- handler in Cancel button of modal dialog
on mouseUp
   set the dialogData to false
   close this stack
end mouseUp

The idea is that you set the dialogData and use it immediately. If  
this doesn't work, there must be some bug.

I'd recommend saving default preferences in a custom property, if your  
stack isn't part of a standalone. If it is, you might want to save  
preferences in global variables and later save these globals ina  
preferences file.

You say modifiable, which might mean that your stack doesn't open as a  
modal dialog. Your stack needs to be modal to make the dialogData work  
reliably.

Do you get a "Do you want to save..." prompt when the modal dialog  
closes? That might explain the problem.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Benefit from our inexpensive hosting services. See http://economy-x-talk.com/server.html 
  for more info.

On 25 jul 2008, at 19:54, Mikey wrote:

> Richard,
> I'm trying to understand whether I have a bug report to file or not,  
> which
> is why I'm asking about this.
>
> I guess the question was - what is the expected behavior if you have a
> modifiable stack that is acting as a dialog.  The reason it's  
> modifiable is
> so that I can have the settings that the user specifies become the new
> defaults.
>
> I hate wasting Oliver's time on crap bug reports, so thus the  
> question.
> -- 
> Mitch Hedberg  - "My fake plants died because I did not pretend to  
> water
> them."
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list