Any message sent to popup menu (btn) when nothing is selected?

Paul Dupuis paul at researchware.com
Tue Apr 12 12:51:30 EDT 2016


I have a user interface problem. A popup menu (a button) is presented.
The button has a number of menu items, some dividers between items, etc.
It has a menuPick handler that covers all the items in the menu
explicitly and a default handler at the end (just for good measure).

I want to take some action IF a user pops up the popup menu, but does
NOT select any menu item (so presses escape or clicks on a non-active
item like a menu divider or just click elsewhere so the popup is dismissed)

The problem is, there appears to be NO message sent to the button of a
popup menu if NO active menu item is selected. The "default" switch
statement option never happens because a menuPick is never sent.
menuPick only get send when an active menu item is selected.

A closeControl to the button when the popup menu is dismissed WOULD have
been another logical possibility but closeControl is only sent to groups
(according to the dictionary)

Has any one else ever needed to take an action if a menu item is NOT
selected from a popup menu? Does anyone have any ideas on how this may
be handled? Should a message be sent to a popup menu button when the
popup menu is dismissed without a menuPick?

If no message exists, should one? Should popup menus send a closeControl
to their button of dismissed without a menuPick? Should this be an
enhancement request for LiveCode version 1,936 (or earlier)? Why do I
run into these weird things?





More information about the use-livecode mailing list