Re: runModalForWindow is disabling my menus
Re: runModalForWindow is disabling my menus
- Subject: Re: runModalForWindow is disabling my menus
- From: Stephane Sudre <email@hidden>
- Date: Sun, 06 Sep 2015 15:31:21 +0200
On Sun, Sep 6, 2015 at 10:20 AM, Felipe Monteiro de Carvalho
<email@hidden> wrote:
> On Sat, Sep 5, 2015 at 8:49 PM, Stephane Sudre <email@hidden> wrote:
>> Which feature of a modal window are you looking for?
>
> Disabling all other windows in the app and staying on top of them.
>
>> Because having
>> all the menu items being enabled in the case of a modal dialog does
>> not match the nature of the modal mode (i.e. restricted mode).
>
> In Mac OS X maybe, but in Linux and Windows there is no problem in a
> modal window having a menu, so its not like its a conceptual problem.
>
>>> Each menu item has itself as target and a method to respond to the action.
>> Why not have at least a shared object as the target?
>
> Why does this make any difference? The target supposedly is just a
> method of an object, I don't see why Cocoa cannot call it. The object
> must remain in memory. And if the object is in memory the method can
> be called.
IMHO, it would just be cleaner both from a code and architecture (MVC)
point of view. Because the final target of your action is not the menu
item.
>
> So you are saying that it would work if the target is not the menu item itself?
Usually, the FirstResponder object would be the target of the menu
item action so that if you implement the action in your window/dialog
controller or in another potential first responder in the dialog, the
menu item will be enabled (even without a validateMenuItem:
implementation).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden