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

NSActionCell — Mac OS X 10.0

Synopsis

This subclass of NSCell provides an implementation of the target/action mechanism that is the basis of interface messaging in Cocoa. This mechanism operates by sending a message, often referred to as an action message to a target object. The majority of controls in the Application Kit rely on the functionality of NSActionCell to notify clients when the control has been activated by the user.

While NSCell implements most of the methods found in NSActionCells, it does so only passively. NSActionCell reimplements many of NSCell’s methods to provide an active target/action mechanism and to manage the target and action of a cell. In addition to managing these attributes of a cell, NSActionCell provides the necessary implementation to provide feedback to mouse actions, such as highlighting certain active areas of a control when the mouse hovers above them.

image with no caption

@interface NSActionCell : NSCell
                                  // Accessor Methods
   - (void)setFloatingPointFormat:(BOOL)autoRange 
                                 left:(unsigned int)leftDigits 
                                 right:(unsigned int)rightDigits;
   - (void)setAlignment:(NSTextAlignment)mode;
   - (void)setBordered:(BOOL)flag;
   - (void)setBezeled:(BOOL)flag;
   - (void)setEnabled:(BOOL)flag;
   - (void)setTag:(int)anInt;
   - (int)tag;
   - (void)setImage:(NSImage *)image;
   - (void)setTarget:(id)anObject;
   - (id)target;
   - (void)setAction:(SEL)aSelector;
   - (SEL)action ...

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