Adopted by | |
Conforms to | |
Framework | /System/Library/Frameworks/AppKit.framework |
Availability | Available in Mac OS X v10.0 and later. |
Companion guide | |
Declared in | NSColorPicking.h |
Together with the NSColorPickingDefault
protocol, NSColorPickingCustom
provides a way to add color pickers—custom user interfaces for color selection—to an application’s NSColorPanel
instance. The NSColorPickingDefault
protocol provides basic behavior for a color picker. The NSColorPicker
class adopts the NSColorPickingDefault
protocol.
Returns the receiver’s current mode (or submode, if applicable).
- (NSColorPanelMode)currentMode
The current color picker mode. The returned value should be unique to your color picker. See this protocol description’s list of the unique values for the standard color pickers used by the Application Kit.
NSColorPicking.h
Returns the view containing the receiver’s user interface.
- (NSView *)provideNewView:(BOOL)initialRequest
YES
only when this method is first invoked for your color picker. If initialRequest is YES
, the method should perform any initialization required (such as lazily loading a nib file, initializing the view, or performing any other custom initialization required for your picker).
The view containing the color picker's user interface. The NSView
returned by this method should be set to automatically resize both its width and height.
This message is sent to the color picker whenever the color panel attempts to display it. This may be when the panel is first presented, when the user switches pickers, or when the picker is switched through an API.
NSColorPicking.h
Adjusts the receiver to make the specified color the currently selected color.
- (void)setColor:(NSColor *)color
The color to set as the currently selected color.
This method is invoked on the current color picker each time NSColorPanel
’s setColor:
method is invoked. If color is actually different from the color picker’s color (as it would be if, for example, the user dragged a color into NSColorPanel
’s color well), this method could be used to update the color picker’s color to reflect the change.
NSColorPicking.h
Returns a Boolean value indicating whether or not the receiver supports the specified picking mode.
- (BOOL)supportsMode:(NSColorPanelMode)mode
The color picking mode.
YES
if the color picker supports the specified color picking mode; otherwise NO
.
This method is invoked when the NSColorPanel
is first initialized: It is used to attempt to restore the user’s previously selected mode. It is also invoked by NSColorPanel
's setMode:
method to find the color picker that supports a particular mode. See this protocol description’s list of the unique mode values for the standard color pickers used by the Application Kit.
NSColorPicking.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-01)