Problem transferring focus to another object

Terry Judd tsj at unimelb.edu.au
Tue Feb 15 15:12:52 EST 2011


On 16/02/11 7:04 AM, "J. Landman Gay" <jacque at hyperactivesw.com> wrote:

> On 2/15/11 1:41 PM, Terry Judd wrote:
>> Thanks Craig - I'm trying to create a cross-platform control so
>> unfortunately I can't use a Mac only option menu. Additionally, I want to
>> use a small text size in the menu - hence the need to fake a menu with a
>> field rather than with a proper menu (the overall effect I'm looking for is
>> like the option menus you see if you do a find (cmd-F in a Finder window on
>> the Mac). Anyway, it turns out it's not so easy to simulate a menu that
>> behaves properly when the mouse is both clicked and left open or
>> continuously held down. I've got it mostly working now - I just have to come
>> up with a method for closing the menu when the user clicks away from it.
> 
> Did you try a mouseRelease handler?

Yep - I'm already using a mouserelease handler, which is fine if you hold
the mouse down while you're doing the menu selection but doesn't catch those
situations where you click to display the menu and then move the cursor with
the mouse unclicked to make a selection. If the user moves on to some other
object without clicking the menu then it stays open.

While it's not ideal, for the moment I'm using a mouseLeave handler to send
a message to check whether the mouse is with the menu 3 seconds later - if
it isn't then I close it.

Terry...

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Melbourne Medical School
The University of Melbourne






More information about the Use-livecode mailing list