• 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
Menu items unexpectedly disabled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Menu items unexpectedly disabled


  • Subject: Menu items unexpectedly disabled
  • From: Todd Heberlein <email@hidden>
  • Date: Fri, 18 Dec 2009 12:50:10 -0800

I have a document-based app. For each document there can be a couple of satellite windows brought up for specific views of some of the data. Each of these satellite windows is controlled by an NSWindowController subclass loaded by MyDocument and added via addWindowController:.  A menu item's target is the First Responder, and the method to implement the action is in MyDocument. Everything works as expected when the primary window is key.

The problem is that when one of the satellite windows is key, menu items implemented by MyDocument are disabled. I thought the responder chain went through the NSWindowController and then through to its NSDocument? Or is this only the case when for the document's primary window (and NSWindowController)?

Note: The work around is trivial. I just implemented the method name in the satellite window's NSWindowController subclass and forwarded the call to the document:

-(IBAction) doMenuThing: (id)sender
{
	[[self document] doMenuThing: sender];
}

but I feel this isn't the "Cocoa Way" of doing it. Am I missing a configuration step?

Todd

_______________________________________________

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: Menu items unexpectedly disabled
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: Dependent values that are not iVars
  • Next by Date: Re: Command+Option+Return not sent to doCommandBySelector:
  • Previous by thread: Re: Picking and Selection
  • Next by thread: Re: Menu items unexpectedly disabled
  • Index(es):
    • Date
    • Thread