• 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
strange problem setting submenu on top level menu item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strange problem setting submenu on top level menu item


  • Subject: strange problem setting submenu on top level menu item
  • From: Martin Redington <email@hidden>
  • Date: Wed, 4 Apr 2007 16:51:24 +0100



I have a top level menu item in the main menu defined in my nib called "Cameras". This has a submenu, but there are no items in that menu.

When a camera is opened, I generate a new NSMenu for that camera. With only one camera, I want that menu to become the sub menu of my Camera menu, so that I end up with

Edit  Camera   Window
      Settings1
      Settings2
      Settings3

However, when I try the following:

    id <NSMenuItem> cameraMenu = [[NApp mainMenu] itemWithTag:1];
    NSMenu *settingsMenuForCamera = [self menuForCamera];
   [cameraMenu setSubmenu:settingsMenuForCamera];

I get

... Edit Camera SettingsMenu Window ...
                Settings1
                Settings2
                Settings3

The Camera menu item is correctly tagged, and is being retrieved ok.

[[NSApp mainMenu] setSubmenu:[settingsMenuForCamera forItem:cameraMenu];

gives me the same result.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Re: characterAtIndex: method and composite characters
  • Next by Date: Re: Unions in Obj-C Code
  • Previous by thread: Re: characterAtIndex: method and composite characters (SOLVED)
  • Next by thread: embedd artworks..
  • Index(es):
    • Date
    • Thread