Re: Help me with creating menus !!!
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.