[GUI] Menu Command Events

Glynn Clements glynn.clements@virgin.net
Tue, 18 Mar 2003 18:22:28 +0000


Krasimir Angelov wrote:

>   Strictly speaking the "initmenu" approach doesn't
> exclude the second approach but only if the "initmenu"
> menu event exists for all target platforms. 

Sure; even with an on-popup callback, the bodies of such callbacks
typically consist of actions which set the states of the menu items. 
Such actions could just as easily be used elsewhere.

The problem with the on-popup approach isn't that it's hard to
implement, but that it only works if menus are guaranteed to be
sufficiently short-lived that the state of the items won't change
while the menu is open (e.g. if the menu is guaranteed to disappear as
soon as an item is activated).

IMHO, providing an on-popup callback is positively inviting
programmers to write code which only works correctly on platforms
which don't support tear-off menus.

-- 
Glynn Clements <glynn.clements@virgin.net>