[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: issue with auto-enable of Menus
From: |
Wolfgang Lux |
Subject: |
Re: issue with auto-enable of Menus |
Date: |
Mon, 13 Nov 2017 18:52:29 +0100 |
> Am 13.11.2017 um 12:54 schrieb Ivan Vučica <ivan@vucica.net>:
>
> To add to thread from a different perspective...
>
> Menu items should auto enable/disable depending on whether the target object
> supports the passed selector.
I'm afraid this logic is too simple. Yes, the target object should support the
selector. But there may be additional conditions: For instance, a paste menu
item should be enabled only when the pasteboard contains content that is
compatible with the receiver. And cut, copy and delete menu items should be
enabled only if the receiver has a non-empty selection.
> Would it make sense to not have custom code to enable/disable menu items, and
> just have appkit do it for you depending on the target?
In my experience, custom code is unavoidable in almost any non-trivial case
because the AppKit is not able to determine exactly when a menu item is
applicable and when not. Having support for the selectors is a necessary but
not a sufficient condition.
Wolfgang
- Re: issue with auto-enable of Menus, (continued)
- Re: issue with auto-enable of Menus, Ivan Vučica, 2017/11/13
- Re: issue with auto-enable of Menus, Riccardo Mottola, 2017/11/13
- Re: issue with auto-enable of Menus,
Wolfgang Lux <=
- Re: issue with auto-enable of Menus, David Chisnall, 2017/11/13
- Re: issue with auto-enable of Menus, Wolfgang Lux, 2017/11/13
- Re: issue with auto-enable of Menus, David Chisnall, 2017/11/14
- Re: issue with auto-enable of Menus, Wolfgang Lux, 2017/11/14
- Re: issue with auto-enable of Menus, David Chisnall, 2017/11/15
- Re: issue with auto-enable of Menus, Riccardo Mottola, 2017/11/14