Search code examples
objective-cmacoscocoacolor-picker

subclass mac OS colorpickers to add a button


I have a color well, that when clicked brings up the Mac OS X NSColorPanel. I have all the default color pickers enabled. However, there are three flavors of each color picker I need. Two are already provided by the show Alpha and don't show Alpha options. I need a third, which I was hoping to just add a toggle button, that would stand for 0 alpha and full (1) alpha.

From what I'm seeing though, you have to create a totally new nib file. Is there a way to use the default colorpickers as a template for this? and then I could just subclass their implementation to look at this toggle button?

I'm looking at http://filibeto.org/unix/macos/lib/dev/documentation/Cocoa/Conceptual/DrawColor/DrawColor.pdf for information on subclassing the NSColorPickers and using the MyColorPicker.xcodeproj example from Apple trying to figure this out.


Solution

  • Use NSColorPicker's accessoryView to add additional controls.