• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: runModalForWindow is disabling my menus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: runModalForWindow is disabling my menus


  • Subject: Re: runModalForWindow is disabling my menus
  • From: Stephane Sudre <email@hidden>
  • Date: Sat, 05 Sep 2015 20:49:59 +0200

On Sat, Sep 5, 2015 at 2:14 PM, Felipe Monteiro de Carvalho
<email@hidden> wrote:
> Hello,
>
> I want to have a modal window which has menus, so I setup the menus
> for the window and make it modal with NSApp.runModalForWindow and
> everything is OK, except that my menu items are all disabled!

Which feature of a modal window are you looking for? 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).

> 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?

> If I only change from runModalForWindow to a non-modal window show,
> then everything works ok!
>
> Any ideas or is it impossible to have menu items and use runModalForWindow?

It's possible to have (enabled) menu items for a window running as
modal. For instance, if you have a NSWindowController subclass
controlling an empty modal window panel, you can add a - (IBAction)
cut:(id)sender {} method to the controller and the Cut menu item will
become enabled.
_______________________________________________

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


  • Follow-Ups:
    • Re: runModalForWindow is disabling my menus
      • From: Felipe Monteiro de Carvalho <email@hidden>
References: 
 >runModalForWindow is disabling my menus (From: Felipe Monteiro de Carvalho <email@hidden>)

  • Prev by Date: Re: runModalForWindow is disabling my menus
  • Next by Date: Re: Puzzling memory creep
  • Previous by thread: Re: runModalForWindow is disabling my menus
  • Next by thread: Re: runModalForWindow is disabling my menus
  • Index(es):
    • Date
    • Thread