Re: Menu Command Events

Daan Leijen <[email protected]>
Newsgroups gmane.comp.lang.haskell.gui
Message-ID <[email protected]>
>> Also, should enabling/disabling menu items be handled in a similar way, using a callback, or should menu items be explicitly enabled/disabled by IO actions like enableMenuItem and disableMenuItem?
>
> Preferably the latter. If a toolkit supports "tear-off" menus, the
> menu can remain on screen for an extended period, so the status of the
> individual menu items can change while the menu is displayed.
>
> Relying upon an on-popup callback is likely to result in tear-off
> menus not working properly.

Well said. I also vote for the latter. Why? it is simpler, it can be implemented anywhere, it is well understood, it is needed anyway to support
tear-off menus, and finally, a toolkit can optionally emit "initmenu" events
for application writers that want to optimize their calls to enable/disableMenuItem.

-- Daan.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.