Re: Finder-like color label menu item in Cocoa?
Re: Finder-like color label menu item in Cocoa?
- Subject: Re: Finder-like color label menu item in Cocoa?
- From: Seth Willits <email@hidden>
- Date: Sun, 23 Jul 2006 16:44:03 -0700
On Jul 23, 2006, at 4:14 PM, James Bucanek wrote:
I assumed that I could simply add the following code to my
application to get started:
static void sInstallCarbonLabelMenuItem( void )
{
MenuRef layerMenuRef;
layerMenuRef = GetMenuHandle(MENU_LAYER);
// place a custom menu item view in the menu
HIViewRef view;
HIViewRef subview;
HIMenuGetContentView( layerMenuRef, kThemeMenuTypePullDown,
&view );
HILabelViewCreate( layerMenuRef, 3, view, &subview,
gAppDelegate, @selector(setLayerTint:) );
HIViewSetVisible( subview, true );
}
But the call to GetMenuHandle() returns NULL. I have a top-level
submenu named "Layers" with a tag of 1300 defined in my NIB. From
the Carbon documentation, GetMenuHandle(1300) should return me a
MenuRef to that menu item. I also know that the menu is valid at
this point becuase it is where I perform other modifications to the
menu bar. Is there some other Carbon stuff I have to do first?
There's a private function you probably want to use:
extern MenuRef _NSGetCarbonMenu( NSMenu *menu);
I'm interested in the end product once you get it working. :)
--
Seth Willits
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden