• 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: Pop-down menu buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pop-down menu buttons


  • Subject: Re: Pop-down menu buttons
  • From: Ken Ferry <email@hidden>
  • Date: Sat, 22 Oct 2005 12:36:21 -0700

On 10/14/05, Matthew Binkowski <email@hidden> wrote:
>
> I was hoping to tap into the knowledge of the list here with this
> question. What is the best and/or easiest way to implement a drop-
> down menu button? The most common example is the Action (Gear) menu
> found in Apple's apps.

The trick here is to realize that a pull-down popup button takes its
title and image from the first item of its associated menu (unless you
change that with -[NSPopUpButtonCell setUsesItemFromMenu:]).  The
first item won't show up in the pull down at runtime.

So: Create a popup button.  Set it to pull down, and give it the
square bezel style.  Set the menu outlet to point at a new NSMenu.
The first item should have no title, and should have an image
appropriate to your button (e.g., the gear).  I don't think you can
set the image of a menu item in IB, so do it in awakeFromNib.

Ken
 _______________________________________________
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

References: 
 >Pop-down menu buttons (From: Matthew Binkowski <email@hidden>)

  • Prev by Date: Re: Cocoa UI in carbon plug-in?
  • Next by Date: FSRefMakePath: error -35
  • Previous by thread: Re: Pop-down menu buttons
  • Next by thread: Re: Brightness -> Alpha mod?
  • Index(es):
    • Date
    • Thread