Re: Pop-down menu buttons
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