• 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: NSPopUpButton/NSMenu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >NSPopUpButton/NSMenu (From: email@hidden)

  • Prev by Date: NSPopUpButton/NSMenu
  • Next by Date: NSTableView changing background
  • Previous by thread: NSPopUpButton/NSMenu
  • Next by thread: NSTableView changing background
  • Index(es):
    • Date
    • Thread