Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights
Reserved.
NSColorPicker
Inherits From: NSObject
Conforms To: NSColorPickingDefault
NSObject (NSObject)
Declared In: AppKit/NSColorPicker.h
Class Description
NSColorPicker is an abstract superclass that implements the
NSColorPickingDefault protocol. The NSColorPickingDefault and
NSColorPickingCustom protocols define a way to add color pickers (custom user
interfaces for color selection) to the NSColorPanel. The simplest way to
implement a color picker is to create a subclass of NSColorPicker, instead of
implementing the NSColorPickingDefault protocol in another kind of object. (To
add functionality, implement the NSColorPickingCustom methods in your
subclass.)
The NSColorPickingDefault protocol specification describes the details of
implementing a color picker and adding it to your application's NSColorPanel;
you should look there first for an overview of how NSColorPicker works. This
specification is provided to document the specific behavior of NSColorPicker's
methods.
Initializing an NSColorPicker
- - (id)initWithPickerMask:(int)aMask Initializes the receiver for
the specified mask and color
colorPanel:(NSColorPanel *)colorPanel panel, caching the
colorPanel value so it can later be returned by the colorPanel
method.
Getting the Color Panel
- - (NSColorPanel *)colorPanel Returns the NSColorPanel that owns this
NSColorPicker.
Adding Button Images
- - (void)insertNewButtonImage:(NSImage *)newImage
in:(NSButtonCell *)newButtonCell Called by the color panel to
insert a new image into the specified cell. Override this method to
customize newImage before insertion in newButtonCell.
- - (NSImage *)provideNewButtonImage Returns the button image for the
color picker. The color panel will place this image in the mode button that the
user uses to select this picker. (This is the same image that the color panel
uses as an argument when sending the insertNewButtonImage:in:
message.) The default implementation looks in the color picker's
bundle for a TIFF file named after the color picker's class, with the extension
".tiff".
Setting the Mode
- - (void)setMode:(int)mode Does nothing. Override to set the color
picker's mode.
Using Color Lists
- - (void)attachColorList:(NSColorList *)colorList Does nothing.
Override to attach a color list to a color picker.
- - (void)detachColorList:(NSColorList *)colorList Does nothing.
Override to detach a color list from a color picker.
Responding to a Resized View
- - (void)viewSizeChanged:(id)sender Does nothing. Override to
respond to a size change.