- Inherits from:
- NSControl : NSView : NSResponder : NSObject
- Conforms to:
- NSCoding
- (NSResponder)
- NSObject (NSObject)
Declared in:
- AppKit/NSColorWell.h
NSColorWell is an NSControl for selecting and displaying a single color value. An example of an NSColorWell object (or simply color well) is found in NSColorPanel, which uses a color well to display the current color selection. A color well is available from the Palettes panel of Interface Builder.
An application can have one or more active color wells. You
can activate multiple color wells by invoking the activate: method
with NO
as its argument. When a mouse-down
event occurs on a color well's border, it becomes the only active
color well. When a color well becomes active, it brings up the color
panel also.
The mouseDown: method enables a color well to send its color to another color well or any other subclass of NSView that implements the NSDraggingDestination protocol.
- Drawing
- - drawWellInside:
- Activating
- - activate:
- - deactivate
- - isActive
- Managing Color
- - color
- - setColor:
- - takeColorFrom:
- Managing Borders
- - isBordered
- - setBordered:
- (void)activate:(BOOL)exclusive
YES
,
deactivates any other color wells; if YES
,
keeps them active. Redraws the receiver. An active color well will
have its color updated when the NSColorPanel's current color changes.
Any color well that shows its border highlights the border when
it's active.See Also: - deactivate, - isActive
- (NSColor *)color
See Also: - setColor:, - takeColorFrom:
- (void)deactivate
See Also: - activate:, - isActive
- (void)drawWellInside:(NSRect)insideRect
- (BOOL)isActive
YES
if
the receiver is active, NO
otherwise.- (BOOL)isBordered
YES
if
the receiver is bordered, NO
otherwise.See Also: - setBordered:
- (void)setBordered:(BOOL)bordered
See Also: - isBordered
- (void)setColor:(NSColor
*)color
See Also: - color, - takeColorFrom:
- (void)takeColorFrom:(id)sender
See Also: - color, - setColor: