Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: CreateMenuFromNib and SetMenu?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CreateMenuFromNib and SetMenu?



Never mind, I just realized I hadn't initialized the menu ID in my NIB (the default is 0) - once I set it to the value I used to have in my resource, it started to work.

However, the documentation does still appear to be wrong...

Kevin G.


I am confused by CreateMenuFromNib() documentation in places such as:
http://developer.apple.com/documentation/Carbon/Reference/ Interface_Builder/ibs_refchap/function_group_2.html#//apple_ref/c/ func/CreateMenuFromNib
that states:
"After you call the function CreateMenuFromNib you need to call the Menu Manager function SetMenu to make the unarchived menu available in your application."

What is the SetMenu function? (In my years of Mac programming I have never heard of it.) Based on the suspiciously-similar wording of the create-menu-bar-from-nib documentation, I am guessing this was a typo from lazily-copied documentation. :(

Anyway, I cannot get a menu created from a NIB to work as I would anticipate. I simply replaced a GetMenu() call with CreateNibReference() and CreateMenuFromNib() calls, and the resultant MenuRef is not equivalent: it appears to automatically insert itself into the front of my menu bar no less than *3 times* (again, I replaced only GetMenu(); my existing InsertMenu() call, etc. remains). Can anyone tell me what I should do to make a NIB menu work?

Thanks in advance,
Kevin G.
http://homepage.mac.com/kmg/
mail to kevin at ieee dot org
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >CreateMenuFromNib and SetMenu? (From: Kevin Grant <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.