[TIP] Focus on custom dialogs (or any window/stack launched from a button)

Ken Ray kray at sonsothunder.com
Thu Feb 23 17:42:19 EST 2006


On 2/23/06 3:36 PM, "Stephen Barncard" <stephenREVOLUTION at barncard.com>
wrote:

> I'm in the process of completing several custom dialog boxes. One in
> particular has been troublesome .
> 
> I have this handler that brings up a custom modal dialog and it's
> wired pretty much by the book and it works perfectly from the message
> box, even with the 'as sheet' option enabled. However, it seems as if
> there's a problem when the handler is invoked from a button.
> 
> What happens is the focus on the launched dialog is <NOT> on itself.
> One must basically click to select the dialog and another time to
> initiate any changes. Annoying and unresponsive. Not the way its
> supposed to work.
> 
> SOLUTION --- after a few test-stacks, etc.
> 
> Make sure the button uses the  mouseUP event to start the handler,
> not mouseDown!

Yes, I've encountered that too... a workaround if you *must" use mouseDown
is to send a message to yourself in like 20 milliseconds and let the
mouseDown handler complete, something like:

on mouseDown
    send "doModal" to me in 20 milliseconds
end mouseDown

on doModal
  modal "MyModalDLOG"
end doModal


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list