Re: NSColorWell inside a custom NSCell
Re: NSColorWell inside a custom NSCell
- Subject: Re: NSColorWell inside a custom NSCell
- From: Graham Cox <email@hidden>
- Date: Mon, 25 Apr 2011 17:52:27 +1000
On 24/04/2011, at 6:01 AM, Ken Ferry wrote:
> That works, but if the stock NSColorWell drawing and behavior is already what you want, you can use normal NSColorWell objects as subviews. Your uber view might be in charge of positioning them.
>
> But definitely, if you don't need to put this in a table, no reason to deal with cells here.
>
> -Ken
Can NSColorWells work well at a non-standard size? The overlap issue means that they'd have to change size while they were actually being dragged when one colour stop "collided" with another. I could be wrong but I think NSColorWell uses a fixed inset for its border edge which ends up proportionally far too large when the well as a whole is made smaller. This is one reason I ended up making my own well-like elements. This was originally written back in the 10.4 days so things may have changed.
I also have had a peek at my code and recall how I allow my fake "wells" to interoperate with the standard ones. It's super-simple. I hold an offscreen NSColorWell subclass in my gradient control object, and when it gets a deactivate message, it simply passes that on to the control, which deactivates the fake wells. Similarly, when I click on a fake well, it tells my offscreen well to activate, thus turning off any other NSColorWell instances in the app.
--Graham
_______________________________________________
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