NSActionCell Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSActionCell.h |
Overview
An NSActionCell defines an active area inside a control (an instance of NSControl or one of its subclasses).
As an NSControl’s active area, an NSActionCell does three things: it usually performs display of text or an icon; it provides the NSControl with a target and an action; and it handles mouse (cursor) tracking by properly highlighting its area and sending action messages to its target based on cursor movement.
Tasks
Configuring an NSActionCell Object
-
– setFloatingPointFormat:left:right:Available in OS X v10.0 through OS X v10.5
Obtaining and Setting Cell Values
-
– integerValue -
– floatValueAvailable in OS X v10.0 through OS X v10.5 -
– intValueAvailable in OS X v10.0 through OS X v10.5 -
– setObjectValue:Available in OS X v10.0 through OS X v10.5 -
– stringValueAvailable in OS X v10.0 through OS X v10.5
Managing the Cell’s View
-
– setControlView: -
– controlViewAvailable in OS X v10.0 through OS X v10.5
Assigning the Target and Action
Assigning a Tag
Instance Methods
action
Returns the receiver’s action-message selector.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.hintegerValue
Returns the receiver’s value as a 64-bit compatible integer after validating any editing of cell content.
Return Value
A 64-bit compatible integer value, as defined by the NSInteger type.
Discussion
If the receiver is not a text-type cell or the cell value is not scannable, the method returns 0.
Availability
- Available in OS X v10.5 and later.
Declared In
NSActionCell.hsetAction:
Sets the selector used for action messages sent by the receiver's control.
Parameters
- aSelector
The selector that identifies the action method to invoke.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.hsetControlView:
Sets the receiver's control view, the view in which it is drawn.
Parameters
- view
The view object, which is normally an NSControl view. Pass in
nilif the receiver has no control view (usually because it hasn’t yet been placed in the view hierarchy).
Discussion
The control view is typically set in the receiver’s implementation of drawWithFrame:inView: (NSCell).
Availability
- Available in OS X v10.4 and later.
Declared In
NSActionCell.hsetTag:
Sets the receiver’s tag.
Parameters
- anInt
An integer tag to be associated with the receiver.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.hsetTarget:
Sets the receiver’s target object.
Parameters
- anObject
The object that is the target of action messages sent by the receiver's control.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.htag
Returns the receiver’s tag.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSActionCell.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-28)