O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSCell — Mac OS X 10.0

Synopsis

This class is the base superclass for the hierarchy of lightweight objects that know how to draw into a view. Most NSControl classes in the Application Kit defer the implementation of drawing to an associated NSCell. For example, NSButton uses a concrete subclass of NSCell, NSButtonCell, to handle all of the drawing and event handling of a button interface component. Cells provide a leaner alternative to using views in situations when a control appears repeatedly in a view. The interface of NSCell is closely mirrored in NSControl; indeed, many concrete subclasses of NSControl forward most messages to their associated NSCell object.

image with no caption

@interface NSCell : NSObject <NSCoding, NSCopying>
                                  // Initializers
   - (id)initImageCell:(NSImage *)image;
   - (id)initTextCell:(NSString *)aString;
                                  // Accessor Methods
   - (void)setBezeled:(BOOL)flag;
   - (void)setType:(NSCellType)aType;
   - (NSCellType)type;
   - (void)setCellAttribute:(NSCellAttribute)aParameter 
                                 to:(int)value;
   - (void)setAllowsMixedState:(BOOL)flag;
   - (BOOL)allowsMixedState;
   - (void)setTarget:(id)anObject;
   - (id)target;
   - (void)setAction:(SEL)aSelector;
   - (SEL)action;
   - (void)setImportsGraphics:(BOOL)flag;
   - (BOOL)importsGraphics;
   - (void)setTag:(int)anInt;
   - (int)tag;
   - (void)setTitle:(NSString*)aString;
   - (NSString*)title;
   - (void)setAllowsEditingTextAttributes

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required