Re: NSPopUpButton/NSMenu
Re: NSPopUpButton/NSMenu
- Subject: Re: NSPopUpButton/NSMenu
- From: Shaun Wexler <email@hidden>
- Date: Thu, 18 Dec 2003 19:20:56 -0800
On Dec 18, 2003, at 6:07 PM, email@hidden wrote:
How does one go about getting only the icon of an NSMenuItem to show
up in an NSPopUpButton control, but when the user clicks the control
to view the menu, the whole menu, including the text labels, show up?
Create a custom subclass of NSPopUpButton. In your -init, you could
[[self cell] setUsesItemFromMenu:NO], and override -drawRect: and grab
the image from the selected item yourself. First call [super
drawRect:rect], then composite the image on top of the "empty" button,
wherever you want.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
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.