• 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: Help me with creating menus !!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help me with creating menus !!!


  • Subject: Re: Help me with creating menus !!!
  • From: Chris Hanson <email@hidden>
  • Date: Thu, 7 Aug 2003 16:42:09 -0500

On Thursday, August 7, 2003, at 10:23 AM, Hasan Diwan wrote:
For having it open a dialogue box:
// assume your dialogue box is in foo.nib
- (void)awakeFromNib {
// rest of your crud
[[[NSApp mainMenu] itemWithTitle:@"Help"] addItemWithTitle:@"Get help" action:@selector(showFoo:) keyEquivalent:@""]; // you must not use keyEquivalent:nil as it will crash your code
}

You can wire up a menu item to an action using Interface Builder without writing any code. Using Interface Builder is generally the preferred way of working with Cocoa.

-- Chris

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Mac OS X Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Help me with creating menus !!! (From: Hasan Diwan <email@hidden>)

  • Prev by Date: Re: display windows
  • Next by Date: Re: Objective-C or C++ or something...
  • Previous by thread: Re: Help me with creating menus !!!
  • Next by thread: dangers in having a view in a toolbaritem
  • Index(es):
    • Date
    • Thread