popup command cross-platform

J. Landman Gay jacque at hyperactivesw.com
Thu Mar 4 19:13:57 EST 2010


Jeff Massung wrote:
> So, I'm seeing different functionality w/ the popup command on OS X and
> Win32, wondering if I should mark this as a bug, and also wondering if
> anyone has a work-around?
> 
> -- in a field's script
> on mouseUp
>    set the backgroundColor of me to "black"
>    popup btn "some menu"
>    set the backgroundColor of me to "white"
> end mouseUp
> 
> On Mac OS X this will set the backgruond color black, popup the menu, and
> wait for me to "cancel" the popup or click a menu item in it, and then set
> the background color back to white. On Win32 the field goes black -> white
> instantly and the popup is still there.
> 
> I much prefer the OS X implementation (given this single context and what I
> want to have happen), but I understand the advantages of the Win32
> implementation. So if it's a bug, I could care less which version was
> considered "correct" by RunRev, but them being different I consider
> incorrect behavior.
> 
> That said, anyone have a workaround for me?

I hadn't noticed that before, but I don't think I've ever changed a 
field during a popup operation either. The only workaround I found is so 
ugly I'm embarrassed. BTW, typically a popup is called on a mousedown 
handler.

on mousedown
    set the backgroundColor of me to "black"
    popup btn 1
    if the platform = "win32" then
       wait until the mouseclick
       click at the clickloc
    end if
    set the backgroundColor of me to "white"
end mousedown

To make it worse, it introduces a slight delay between the time of the 
mouseclick and the menu selection. But it sort of works.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list