Re: Emulating Carbon menu bevel button?
Re: Emulating Carbon menu bevel button?
- Subject: Re: Emulating Carbon menu bevel button?
- From: Jo Meder <email@hidden>
- Date: Tue, 26 May 2009 14:39:35 +1200
Hi Kyle,
On 26/05/2009, at 8:04 AM, Kyle Sluder wrote:
That's what I'm doing, by emulating the Carbon control. I think
this is a
deficiency in Cocoa, I don't see how it's possible implement the
bevel
button with a popup menu as shown in the HIG, where the button
represents
the menu title and always displays the same image. The Carbon
control is a
very useful one which I've been using for over a decade I suppose.
I was
just interested to know if anyone else had done this and what
approach they
took.
So what you want is a pull-down menu, not a pop-up menu? Same class,
different behavior.
I was confusing my terminology, what I'm after is a pull down list in
Cocoa terms. The HIG refers to the menus in this situation as pop-up
menus though.
If you do want the pop-up behavior, minus the changing of the button
title, look at -[NSPopUpButtonCell setUsesItemFromMenu:]. Be careful,
though, I've found it to be pretty buggy.
I'd overlooked that, I've just given it a try. It still seems to
cause the first menu item to disappear if you use -setMenu: though
unfortunately. I realise that's the way the popup button works, it's
just not very clear in the docs particularly when you set a menu
explicitly. Having gone through all this I now know it's possible to
get a lot closer to the Carbon control, but the Cocoa one still seems
a bit awkward and less versatile.
Regards,
Jo Meder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden