Re: advice for creating these controls
Re: advice for creating these controls
- Subject: Re: advice for creating these controls
- From: Lee Ann Rucker <email@hidden>
- Date: Thu, 22 Mar 2012 21:49:16 -0700 (PDT)
The button/popup combo could still be an NSSegmentedControl. Getting a menu on a segment is just a matter of setMenu:forSegment: - the triangle would have to be part of the icon, because it doesn't do it for you.
----- Original Message -----
From: "Seth Willits" <email@hidden>
To: "Cocoa-Dev List" <email@hidden>
Sent: Thursday, March 22, 2012 1:32:11 PM
Subject: Re: advice for creating these controls
On Mar 22, 2012, at 7:14 AM, Rick C. wrote:
> Just looking for an opinion what's the best way to create controls like this:
>
> http://cl.ly/191V3Z1C0m2k2U0V443x
>
> I initially assumed subclassing NSSegmentedControl, but then I was thinking maybe I can just subclass NSButton and put them together. Or maybe even make this out of a custom view? Any help would be appreciated thanks,
Well it depends on what exactly you mean. Do you want the exact look, or just the functionality and behavior? The bottom two are just plain NSSegmentedControls with a custom appearance. If you want the same appearance, you'll have to subclass it and draw the segments yourself.
The button/popup combo is a custom control. You coooould make it out of two customized controls, a button and a popup and smoosh them together (the button would draw no right edge, and the popup would draw the vertical separator as its left edge), or you could make it a single custom control. Either approach would work, but I always do the latter.
--
Seth Willits
_______________________________________________
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
_______________________________________________
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