Pulldownmenu button bug on Windows
Craig Newman
craig at starfirelighting.com
Fri Apr 29 09:07:31 EDT 2022
Hi.
I will say again that the format of the forum is so much easier to work with.
I made a pulldown and two fields, with these two handlers in the button script:
on menuPick pItemName
put pItemname into fld 1
end menuPick
on mouseleave
put random(999) into fld 2
end mouseleave
On my Mac ( I will never voluntarily use Windows) the menuItem is always nicely placed into fld 1 after being selected. A random number appears in fld 2 nicely as well.
The mouseLeave handler fires immediately if I just enter the button rect and leave it without ever clicking the mouse to invoke a menu. Makes sense.
What I found interesting is that when the cursor is below the actual button, "within" the pulldown menu space, that handler fires after an ordinary menu selection,. It is as if the mouse has “left” the button rect by virtue of the menu “space” disappearing after a selection is made. Either that or LC “sees” the entirety of the button and the menu space as its rect.
Whatever. But that is how the Mac works. I apologize, but I see that I have been of no help to you at all.
Craig
> On Apr 28, 2022, at 11:25 PM, Neville Smythe via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> I have a pulldown menu button which has a menupick script and also a mouseLeave script.
>
> On a Mac, when a user brings up the menu and drags the mouse down to select a menu item (leaving the button rect but within the pulldown menu), the menupick handler is invoked, and then the mouseleave handler is called. This is what I expected.
>
> However on Windows, the mouseleave script is called immediately the mouse leaves the button while the user is still in the process of making the selection, and then menupick is called if the user actually makes the selection.
>
> Which means standalones behave quite differently (in my app, the menupick did something to a selection in a field, and mouseleave did something else to the selection: the order is thus critical).
>
> They can’t both be right, so certainly one is a bug. The Mac order is IMO correct since the pulldown menu has been started by the user so the app should be in a modal state until the menu selection is resolved.
>
> Neville
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list