Re Pulldownmenu button bug on Windows
Neville Smythe
neville.smythe at optusnet.com.au
Sun May 8 20:05:06 EDT 2022
Thanks Richard for your wise observations.
As cross-platform developers we do indeed need to be aware of differences that will arise in standalones because of GUI differences in the operating systems – different placement of menus, different text string lengths, some features not even being available. These things are largely well-known and documented with warnings.
But I contend this problem is something different. Here the order of processing user events from an LC object is different. Although this may indeed be an artefact of the way the LC button menu objects are implemented, I don’t think the developer could be expected to expect this, and to my mind that makes it a definite bug. If it occurred with more common event pairs, LC coding would be much more difficult.
I am not actually fussed which processing order is accepted as “correct”: although I expressed an IMO preference for the order as implemented on a Mac, the case for the opposite order is at least as strong.
My use-case was as follows. I have a pulldownmenu, not an application-wide menu, which applied to only certain selected items in a field. On mouseEnter, the selection changed colour, as a visual cue to the user that these menu items could be applied to the selection. On mouseLeave the colour changed back. At some point I inadvertently added a line of code to the mouseLeave handler which had the effect of killing the selection; this line was supposed to go into the menuPick handler. On my Mac the app continued to work as intended, but on a user's Windows PC the effect was to change a very minor cosmetic difference into a major bug because the menu no longer did anything. This was quite difficult to track down.
As to the priority of the bug: very low. Unless it turns to be easy to fix I don’t expect the inconsistency will ever be fixed even if the expert review agrees that it is actually a bug. Consistency of event order across platforms is clearly of very high importance, but this is a pretty extreme edge case, which only cropped up for me because of my own coding mistake. I reported it here because it caused me grief and I thought it of general interest. If anyone else is bitten and is looking for documentation, it is probably sufficient that the matter is now on record at least for readers of this list and in the bug submission.
Neville
More information about the use-livecode
mailing list