Up
Authors
- Scott Christley (
scottc@net-community.com)
-
Date: Generated at 2025-12-03
The abstract cell class
Copyright: (C) 1996-2012,2019 Free Software Foundation, Inc.
- Declared in:
- AppKit/NSCell.h
- Conforms to:
- NSCoding
- NSCopying
Availability: OpenStep
NSCell is the abstract base class that defines the
fundamental behavior for objects that display
content and handle user interaction within controls.
Cells are lightweight objects that can display text,
images, or other content without the overhead of a
full view. They are commonly used as components within
controls like buttons, text fields, and table views
to provide efficient rendering and interaction handling.
The cell architecture separates the visual representation
and behavior from the containing control, allowing
multiple cells to share common functionality while
being customized for specific display requirements.
This design enables efficient memory usage and fast
drawing performance for controls that display many
similar elements. NSCell provides comprehensive
support for various content types including plain
text, attributed strings, images, and formatted data
through formatters. It handles user interaction
through target-action patterns, supports various
visual states like highlighting and
enabling/disabling, and provides
extensive customization options for appearance and
behavior. Common subclasses include NSTextFieldCell
for text display and editing, NSButtonCell for
button-like behavior, NSImageCell for image
display, and various specialized cells for specific
control types. The cell system forms the foundation
for most user interface controls in the AppKit.
TODO Desctiption
NSCell declares 11 Instance Variables
+ (
NSFocusRingType)
defaultFocusRingType;
Availability: MacOS-X 10.3.0
Returns the default focus ring type used by cells
when no specific focus ring type has been set. The
focus ring provides visual indication when a cell has
keyboard focus, helping users understand which
element will respond to keyboard input. The default
type depends on system preferences and the current
user interface theme.
+ (
NSMenu*)
defaultMenu;
Availability: MacOS-X 10.0.0
Returns the default menu used by cells when no
specific menu has been assigned. This provides a
standard context menu for cell interactions,
typically containing common operations like copy,
paste, and formatting options appropriate for the
cell's content type and current state.
+ (BOOL)
prefersTrackingUntilMouseUp;
Availability: OpenStep
Returns whether cells prefer to continue tracking
mouse events until the mouse button is released,
rather than stopping when the mouse leaves the
cell's bounds. This affects how cells handle
extended mouse interactions and determines the
default tracking behavior for mouse-down events
within cell boundaries.
This class method returns NO. This
method should be overrided by subclasses.
- (BOOL)
acceptsFirstResponder;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (SEL)
action;
Availability: OpenStep
- (
NSTextAlignment)
alignment;
Availability: OpenStep
Returns the text alignment setting for the cell's
content. This determines how text is positioned
within the cell's bounds, with options for left,
right, center, justified, and natural alignment
based on the text's writing direction and locale
preferences.
Returns the alignment of the text used in the
NSCell. See
NSTextAlignment
for more informations. By default the text alignment
is
NSJustifiedTextAlignment
See Also:
-setAlignment:
- (BOOL)
allowsEditingTextAttributes;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (BOOL)
allowsMixedState;
Availability: OpenStep
Returns whether the cell supports a mixed state in
addition to its primary on and off states. Mixed
state is useful for hierarchical controls where some
but not all child elements are selected, or for
representing indeterminate conditions in the
user interface.
- (BOOL)
allowsUndo;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (
NSAttributedString*)
attributedStringValue;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSBackgroundStyle)
backgroundStyle;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (
NSWritingDirection)
baseWritingDirection;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
calcDrawInfo: (
NSRect)aRect;
Availability: OpenStep
Does nothing. This method is used by subclasses to
recalculate sizes
It is usally called from a NSControl object
See Also:
[NSControl -calcSize]
Not implemented (as of 2025-12-03).
Please help us by producing an implementation
of this and donating it to the GNUstep project.
- (
NSInteger)
cellAttribute: (
NSCellAttribute)aParameter;
Availability: MacOS-X 10.5.0
Returns the value of the specified cell attribute
parameter. Cell attributes control various
aspects of the cell's behavior and appearance, such
as whether it's selectable, editable, or has scrollable
content. The returned value interpretation depends
on the specific attribute type.
Returns some NSCell's attributes for the
specified
NSCellAttribute
See Also:
-setCellAttribute:to:
- (
NSSize)
cellSize;
Availability: OpenStep
Returns the minimun size needed to display the
NSCell. This size is calculate by adding :
-
the borders (plain or bezeled) size
-
the spacing between the border and inside the cell
-
the TODO... if the cell is type of NSTextCellType
or the image size if the cell has a NSImageCellType
type.
This method returns NSZeroSize if the cell has a
NSNullCellType type (Cocoa returns a very
big size instead).
- (
NSSize)
cellSizeForBounds: (
NSRect)aRect;
Availability: OpenStep
- (
NSComparisonResult)
compare: (id)otherCell;
Availability: OpenStep
Compares the reciever to another to another
NSCell. The argument must be an NSCell sublclass
and have the NSCellType NSTextCellType. Returns the
result of the comparison of each cell's stringValue.
- (BOOL)
continueTracking: (
NSPoint)lastPoint
at: (
NSPoint)currentPoint
inView: (
NSView*)controlView;
Availability: OpenStep
- (
NSControlSize)
controlSize;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSControlTint)
controlTint;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSView*)
controlView;
Availability: OpenStep
This method is used by subclasses to get the control
view. This method returns nil.
- (double)
doubleValue;
Availability: OpenStep
Returns the cell's value as a double-precision
floating point number. If the cell's content
cannot be converted to a numeric value, this returns
zero. The conversion handles various string
representations of numbers and uses any
assigned formatter for interpretation.
Returns the NSCell's value as a
double.
See Also:
-setDoubleValue:
- (void)
drawInteriorWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
This drawing is minimal and with no background, to
make it easier for subclass to customize drawing.
- (void)
drawWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
Draws the cell in controlView
- (
NSRect)
drawingRectForBounds: (
NSRect)theRect;
Availability: OpenStep
- (void)
editWithFrame: (
NSRect)aRect
inView: (
NSView*)controlView
editor: (
NSText*)textObject
delegate: (id)anObject
event: (
NSEvent*)theEvent;
Availability: OpenStep
.This method does nothing if a the
controlView is nil, if text
object does not exist or if the cell's type is not
NSTextCellType
- (void)
endEditing: (
NSText*)textObject;
Availability: OpenStep
- (
NSInteger)
entryType;
Availability: OpenStep
- (float)
floatValue;
Availability: OpenStep
Returns the cell's value as a single-precision
floating point number. Similar to doubleValue,
this converts the cell's content to a numeric
representation, returning zero if
conversion is not possible. Formatters are used
if available to interpret string representations of
numbers.
Returns the cell's value as a
float.
See Also:
-setFloatValue:
- (
NSFocusRingType)
focusRingType;
Availability: MacOS-X 10.3.0
Description forthcoming.
- (
NSFont*)
font;
Availability: OpenStep
Returns the font used for displaying the cell's
text content. The font determines the typeface, size,
and style characteristics used for rendering text,
affecting both appearance and text metrics for
layout calculations within the cell's display area.
Returns the font of the text used in the NSCell
See Also:
-setFont:
- (id)
formatter;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
getPeriodicDelay: (float*)delay
interval: (float*)interval;
Availability: OpenStep
Gets the NSCell's delay and the
interval parameters used when NSCell
sends continouly action messages. The NSCell
implementation sets delay to
0.2 and interval to 0.025.
See Also:
-trackMouse:inRect:ofView:untilMouseUp:
- (BOOL)
hasValidObjectValue;
Availability: OpenStep
Returns whether the cell currently contains a valid
object value. This indicates if the cell's content
represents valid data that can be used for
display or processing, as opposed to placeholder or
invalid content that might result from failed
validation or parsing.
- (void)
highlight: (BOOL)lit
withFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
- (
NSColor*)
highlightColorWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSUInteger)
hitTestForEvent: (
NSEvent*)event
inRect: (
NSRect)cellFrame
ofView: (
NSView*)controlView;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (
NSImage*)
image;
Availability: OpenStep
- (
NSRect)
imageRectForBounds: (
NSRect)theRect;
Availability: OpenStep
Frame the image gets drawn in
- (BOOL)
importsGraphics;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (id)
initImageCell: (
NSImage*)anImage;
Availability: OpenStep
Initializes a cell for displaying an image. The
cell is configured with image display capabilities and
the specified image becomes the cell's primary content.
This creates an NSImageCellType cell that is optimized
for image rendering and handles image-specific display
properties like scaling and positioning within
the cell bounds.
Initializes and returns a new NSCell with a
NSImage anImage. This method sets the
image position to
NSImageOnly
and the cell's type to
NSImageCellType
.
See Also:
-initTextCell:
- (id)
initTextCell: (
NSString*)aString;
Availability: OpenStep
Initializes a cell for displaying text content.
The cell is configured as an NSTextCellType with the
specified string as its initial content. This
creates a text-capable cell that supports text
editing, formatting, and display properties like
font, alignment, and text attributes.
Initializes and returns a new NSCell with a
NSString aString. This method sets
the cell's type to
NSTextCellType
.
See Also:
-initImageCell:
- (int)
intValue;
Availability: OpenStep
Returns the cell's value as an integer. The cell's
content is converted to an integer representation,
with string values parsed numerically. Non-numeric
content results in a return value of zero.
Formatters assist in interpreting complex string
representations when present.
Returns the cell's value as an
int.
See Also:
-setIntValue:
- (
NSInteger)
integerValue;
Availability: MacOS-X 10.5.0
- (BOOL)
isBezeled;
Availability: OpenStep
Returns whether the cell is drawn with a bezeled
appearance. Bezeled cells have a
three-dimensional border that creates a
raised or recessed visual effect, commonly used for
buttons and other interactive elements to provide
visual feedback about their clickable nature.
Returns whether the NSCell has a bezeled border.
By default a NSCell has no bezeled border
See Also:
-setBezeled:
- (BOOL)
isBordered;
Availability: OpenStep
Returns whether the cell is drawn with a simple
border. Bordered cells have a flat outline around
their content area, providing visual separation
without the dimensional effects of bezeling. This
is often used for text fields and other content areas
that need clear boundaries.
Returns whether the NSCell has a border. By
default a NSCell has border
See Also:
-setBordered:
-setBezeled:
-isBezeled
- (BOOL)
isContinuous;
Availability: OpenStep
Returns whether the cell can continuously send
its action messages.
See Also:
-setContinuous:
- (BOOL)
isEditable;
Availability: OpenStep
Returns whether the cell's text content can be
edited by the user. Editable cells allow direct text
input and modification, typically displaying a text
cursor and accepting keyboard input when activated.
Non-editable cells display text as read-only
content.
Returns whether the cell is editable.By default a
NSCell is not editable.
See Also:
-setEditable:
- (BOOL)
isEnabled;
Availability: OpenStep
Returns whether the cell is currently enabled for
user interaction. Enabled cells respond to user
actions like clicks and key presses, while disabled
cells typically appear dimmed and ignore user input.
This setting affects both visual appearance and
interactive behavior.
Returns whether the NSCell can respond to mouse
events.
See Also:
-setEnabled:
- (BOOL)
isEntryAcceptable: (
NSString*)aString;
Availability: OpenStep
Description forthcoming.
- (BOOL)
isHighlighted;
Availability: OpenStep
Returns whether the cell is highlighted. By
default NO
See Also:
-setHighlighted:
- (BOOL)
isOpaque;
Availability: OpenStep
Returns whether the cell is completely opaque when
drawn. Opaque cells fill their entire bounds with
content, allowing the drawing system to optimize
rendering by skipping transparency calculations.
Non-opaque cells may have transparent areas that
blend with background content.
Returns whether the cell is opaque. Return
NO by default
- (BOOL)
isScrollable;
Availability: OpenStep
Returns whether the cell's content area supports
scrolling when the content exceeds the visible
bounds. Scrollable cells can display content larger
than their frame by allowing users to scroll through
the text or other content using keyboard navigation or
scroll gestures.
Returns whether the NSCell is scrollable. By
default a NSCell is not scrollable
See Also:
-setScrollable:
- (BOOL)
isSelectable;
Availability: OpenStep
Returns whether the cell's text content can be
selected by the user. Selectable cells allow users
to highlight text for copying or other operations, even
if the text cannot be edited. This is useful for
displaying copyable information in read-only
contexts.
Returns whether the cell is selectable. This
method returns YES if the cell is
selectable or editable. NO
otherwise
See Also:
-setSelectable:
-isEditable
-setEditable:
- (
NSString*)
keyEquivalent;
Availability: OpenStep
Implemented by subclasses to returns the key
equivalent. The NSCell implementation returns
an empty NSString.
- (
NSLineBreakMode)
lineBreakMode;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (
NSMenu*)
menu;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSMenu*)
menuForEvent: (
NSEvent*)anEvent
inRect: (
NSRect)cellFrame
ofView: (
NSView*)aView;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSString*)
mnemonic;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSUInteger)
mnemonicLocation;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSInteger)
mouseDownFlags;
Availability: OpenStep
- (
NSInteger)
nextState;
Availability: OpenStep
Returns the state value that would follow the
current state in the cell's state cycle. For cells
with mixed state support, this cycles through off, on,
and mixed values. For binary cells, it alternates
between off and on states as appropriate for the
cell type.
- (id)
objectValue;
Availability: OpenStep
Returns the cell's current value as an object. This
is the primary method for accessing the cell's content
in its native object form, which could be a string,
number, date, or other object type depending on the
cell's configuration and the type of data it
represents.
- (void)
performClick: (id)sender;
Availability: MacOS-X 10.0.0
Simulates a single click in the cell (only works
with controls which have no more than one cell). This
method is deprecated, performClickWithFrame:inView:
is the right method to use now.
- (void)
performClickWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: MacOS-X 10.0.0
Simulates a single click in the cell. The display
of the cell with this event occurs in the area delimited
by cellFrame within controlView.
- (BOOL)
refusesFirstResponder;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (id)
representedObject;
Availability: OpenStep
- (void)
resetCursorRect: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
- (void)
selectWithFrame: (
NSRect)aRect
inView: (
NSView*)controlView
editor: (
NSText*)textObject
delegate: (id)anObject
start: (
NSInteger)selStart
length: (
NSInteger)selLength;
Availability: OpenStep
This method does nothing if the
controlView is nil, if text
object does not exist or if the cell's type is not
NSTextCellType
- (BOOL)
sendsActionOnEndEditing;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setAction: (SEL)aSelector;
Availability: OpenStep
Implemented by subclasses to set the action
method. The NSCell implementation raises a
NSInternalInconsistencyException
See Also:
-action
-setTarget:
-target
- (void)
setAlignment: (
NSTextAlignment)mode;
Availability: OpenStep
Sets the text alignment for content displayed within
the cell. The alignment affects how text is positioned
horizontally within the cell's bounds and may
interact with the text's natural writing direction
for proper internationalization support.
Sets the alignment of the text. See
NSTextAlignment
.
See Also:
-alignment
- (void)
setAllowsEditingTextAttributes: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setAllowsMixedState: (BOOL)flag;
Availability: OpenStep
Sets whether the cell should support mixed state
functionality. When enabled, the cell can
display and respond to a third state between its
primary on and off conditions, typically used for
partial or indeterminate selections in hierarchical
or grouped controls.
- (void)
setAllowsUndo: (BOOL)flag;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
setAttributedStringValue: (
NSAttributedString*)attribStr;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setBackgroundStyle: (
NSBackgroundStyle)backgroundStyle;
Availability: MacOS-X 10.5.0
Description forthcoming.
- (void)
setBaseWritingDirection: (
NSWritingDirection)direction;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
setBezeled: (BOOL)flag;
Availability: OpenStep
Sets whether the cell should be drawn with a bezeled
appearance. When enabled, the cell displays
with three-dimensional border effects that create
visual depth. This is typically used for interactive
elements like buttons to indicate their pressable
nature to users.
Sets whether the cell has a bezeled border. If this
method is called, the bordered flag is
turn off. By default a NSCell has no bezeled border
See Also:
-isBezeled
-setBordered:
-isBordered
- (void)
setBordered: (BOOL)flag;
Availability: OpenStep
Sets whether the cell should be drawn with a simple
border outline. Bordered cells have a flat perimeter
that defines their content area without
three-dimensional effects. This provides
clear visual boundaries while maintaining a clean,
flat appearance for modern interfaces.
Sets whether the cell has a border. If this method
is called, the bezeled flag is turn off. By
default a NSCell has no border
See Also:
-isBordered
-setBezeled:
-isBezeled
- (void)
setCellAttribute: (
NSCellAttribute)aParameter
to: (
NSInteger)value;
Availability: MacOS-X 10.5.0
Sets the
value for the specified cell
attribute parameter. This method configures
various behavioral and display characteristics of
the cell by modifying the appropriate attribute flags.
Different attributes accept different
value ranges and meanings for their
parameters.
TODO
See Also:
-cellAttribute:
- (void)
setContinuous: (BOOL)flag;
Availability: OpenStep
Sets whether the cell can continuously send its
action messages.
See Also:
-isContinuous
- (void)
setControlSize: (
NSControlSize)controlSize;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setControlTint: (
NSControlTint)controlTint;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setControlView: (
NSView*)view;
Availability: MacOS-X 10.4.0
This method is used by subclasses to specify the
control view.
Not implemented (as of 2025-12-03).
Please help us by producing an implementation
of this and donating it to the GNUstep project.
- (void)
setDoubleValue: (double)aDouble;
Availability: OpenStep
Sets the cell's value from a double-precision floating
point number. The numeric value is stored and can be
retrieved in various formats. If a formatter is
assigned to the cell, it may be used to control
how the numeric value is displayed as text.
Sets the NSCell's value to aDouble.
See Also:
-doubleValue
- (void)
setEditable: (BOOL)flag;
Availability: OpenStep
Sets whether the cell's text content should be
editable by users. Editable cells support direct
text input and modification, while non-editable cells
display content as read-only. This affects both the
visual appearance and the interactive behavior of
the cell.
Sets whether the NSCell's text is editable.
See Also:
-isEditable
-setSelectable:
-isSelectable
- (void)
setEnabled: (BOOL)flag;
Availability: OpenStep
Sets whether the cell should be enabled for user
interaction. When disabled, the cell typically
appears grayed out and does not respond to user
actions. This is commonly used to indicate
unavailable functionality or to prevent
interaction during processing states.
Sets whether the NSCell can respond to mouse events
See Also:
-isEnabled
- (void)
setEntryType: (
NSInteger)aType;
Availability: OpenStep
- (void)
setFloatValue: (float)aFloat;
Availability: OpenStep
Sets the cell's value from a single-precision floating
point number. Similar to setDoubleValue, this stores
a numeric value that can be accessed in different formats
and displayed according to any assigned formatter's
specifications for numeric presentation.
Sets the NSCell's value to a aFloat. This
used for example in NSSliderCell
See Also:
-floatValue
- (void)
setFloatingPointFormat: (BOOL)autoRange
left: (
NSUInteger)leftDigits
right: (
NSUInteger)rightDigits;
Availability: OpenStep
Description forthcoming.
- (void)
setFocusRingType: (
NSFocusRingType)type;
Availability: MacOS-X 10.3.0
Description forthcoming.
- (void)
setFont: (
NSFont*)fontObject;
Availability: OpenStep
Sets the font to be used for displaying the cell's
text content. The font affects the visual appearance,
size, and style of rendered text, and influences
layout calculations for text positioning and cell
sizing based on content requirements.
Sets the text font. The NSCell's type is set to
NSTextCellType if needed
See Also: -font
-setType:
-type
- (void)
setFormatter: (
NSFormatter*)newFormatter;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setHighlighted: (BOOL)flag;
Availability: MacOS-X 10.0.0
- (void)
setImage: (
NSImage*)anImage;
Availability: OpenStep
Sets the NSCell's image to anImage. This
method sets the cell's type to NSImageCellType if
needed. Raises an NSInvalidArgumentException if
the anImage is not an NSImage (sub)class.
The new image is retained and the old one is released
See Also: -image
- (void)
setImportsGraphics: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setIntValue: (int)anInt;
Availability: OpenStep
Sets the cell's value from an integer. The integer
value is stored and becomes available through the
various value accessor methods. Display formatting
is handled by any assigned formatter, allowing for
customized presentation of the numeric content.
Sets the NSCell's value to anInt.
See Also:
-intValue
- (void)
setIntegerValue: (
NSInteger)anInt;
Availability: MacOS-X 10.5.0
- (void)
setLineBreakMode: (
NSLineBreakMode)mode;
Availability: MacOS-X 10.4.0
Description forthcoming.
- (void)
setMenu: (
NSMenu*)aMenu;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setMnemonicLocation: (
NSUInteger)location;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setNextState;
Availability: OpenStep
Advances the cell to its next state in the state
progression cycle. This method updates the
cell's state value to the next logical value,
cycling through available states as determined by
the cell's configuration and mixed state support
settings.
- (void)
setObjectValue: (id)object;
Availability: OpenStep
Sets the cell's value using an arbitrary
object. This is the primary method for
setting cell content and accepts any
object type. The cell stores the
object and uses it for display and value
conversion operations. Pass nil to
clear the cell's content.
- (void)
setRefusesFirstResponder: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setRepresentedObject: (id)anObject;
Availability: OpenStep
Sets the NSCell's represented object to
anObject. anObject will be
retain.
See Also:
-representedObject
- (void)
setScrollable: (BOOL)flag;
Availability: OpenStep
Sets whether the cell should support scrolling when
content exceeds the visible area. Scrollable cells
can accommodate content larger than their display
bounds by enabling navigation through the content
using keyboard controls or other scrolling
mechanisms.
Sets whether the NCell is scrollable. By default a
NSCell is not scrollable
See Also:
-isSelectable
- (void)
setSelectable: (BOOL)flag;
Availability: OpenStep
Sets whether the cell's text content should be
selectable by users. Selectable cells allow text
highlighting for operations like copying, even
when editing is disabled. This enables user
interaction with text content without allowing
modifications.
Sets whether the cell selectable. Making a cell
unselectable also makes it uneditable until
a
-setEditable:
re-enables it.
See Also:
-isSelectable
-setEditable:
-isEditable
- (void)
setSendsActionOnEndEditing: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setShowsFirstResponder: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setState: (
NSInteger)value;
Availability: OpenStep
Sets the cell's state
value which controls
its visual appearance and behavior. Common state values
include on, off, and mixed states for controls like
checkboxes and buttons. The state affects how
the cell renders itself and may trigger associated
actions when changed.
Sets the NSCell's state. Please use always symbolic
constants when calling this method. The integer
values could be changed in the this
implementation. (Currently they match the
Cocoa values but they are quite strange)
See Also: -state
- (void)
setStringValue: (
NSString*)aString;
Availability: OpenStep
Sets the cell's value from a string. The string
becomes the cell's content and may be parsed into
other data types when accessed through numeric value
methods. Formatters can provide additional parsing
and validation capabilities for string content
interpretation.
Sets the cell's value to a NSString. The NSCell's
type is set to NSTextCellType if needed
See Also:
-stringValue
- (void)
setTag: (
NSInteger)anInt;
Availability: OpenStep
Implemented by sublclasses to assigns the tag
anInt. The NSCell implementation raises
an NSInvalidArgumentException.
See Also: -tag
- (void)
setTarget: (id)anObject;
Availability: OpenStep
Implemented by subclasses to set the target
object. The NSCell implementation raises a
NSInternalInconsistencyException
See Also:
-target
-setAction:
-action
- (void)
setTitle: (
NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setTitleWithMnemonic: (
NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (void)
setType: (
NSCellType)aType;
Availability: OpenStep
Sets the cell's type which determines its fundamental
display and interaction characteristics. The type
affects how the cell renders its content, handles
user interaction, and manages its internal state.
Common types include text cells and image cells.
Sets the NSCell's type. See
NSCellType
.If the cell is set to NSTextCellType, the cell is
given a default title and is reset to the default
system font.
See Also: -type
- (
NSText*)
setUpFieldEditorAttributes: (
NSText*)textObject;
Availability: OpenStep
Description forthcoming.
- (void)
setUsesSingleLineMode: (BOOL)flag;
Availability: MacOS-X 10.6.0
Description forthcoming.
- (void)
setWraps: (BOOL)flag;
Availability: OpenStep
Sets whether text content should wrap to multiple
lines when it exceeds the cell's width. Text wrapping
allows longer content to be displayed by breaking it
across lines rather than truncating or requiring
horizontal scrolling to view all content.
- (BOOL)
showsFirstResponder;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (BOOL)
startTrackingAt: (
NSPoint)startPoint
inView: (
NSView*)controlView;
Availability: OpenStep
- (
NSInteger)
state;
Availability: OpenStep
Returns the cell's current state value. The state
represents the cell's current condition or
setting, such as whether a checkbox is checked,
unchecked, or in a mixed state. This value
determines the cell's visual representation and
behavioral characteristics.
Returns the NSCell's state
See Also:
-setState:
- (void)
stopTracking: (
NSPoint)lastPoint
at: (
NSPoint)stopPoint
inView: (
NSView*)controlView
mouseIsUp: (BOOL)flag;
Availability: OpenStep
Default implementation of this method in NSCell
does nothing.
Not implemented (as of 2025-12-03).
Please help us by producing an implementation
of this and donating it to the GNUstep project.
- (
NSString*)
stringValue;
Availability: OpenStep
Returns the cell's value as a string
representation. This provides a textual
representation of the cell's content
regardless of the underlying data type. Objects
are converted using their string description methods,
and formatters are applied when available.
Returns the cell's value as a NSString.
See Also:
-setStringValue:
- (
NSInteger)
tag;
Availability: OpenStep
Implemented by subclasses to Return the tag.
The NSCell implementation returns -1
See Also:
-setTag:
- (void)
takeDoubleValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's double value to
sender's double value
See Also:
-setDoubleValue:
- (void)
takeFloatValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's float value to
sender's float value
See Also:
-setFloatValue:
- (void)
takeIntValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's int value to
sender's int value
See Also:
-setIntValue:
- (void)
takeIntegerValueFrom: (id)sender;
Availability: MacOS-X 10.5.0
Sets the NSCell's NSInteger value to sender's
NSInteger value
See Also:
-setIntegerValue:
- (void)
takeObjectValueFrom: (id)sender;
Availability: OpenStep
Description forthcoming.
- (void)
takeStringValueFrom: (id)sender;
Availability: OpenStep
Sets the NSCell's NSString value to sender's NSSting
value
See Also:
-setStringValue:
- (id)
target;
Availability: OpenStep
- (
NSString*)
title;
Availability: MacOS-X 10.0.0
Description forthcoming.
- (
NSRect)
titleRectForBounds: (
NSRect)theRect;
Availability: OpenStep
Frame the title gets drawn in
- (BOOL)
trackMouse: (
NSEvent*)theEvent
inRect: (
NSRect)cellFrame
ofView: (
NSView*)controlView
untilMouseUp: (BOOL)flag;
Availability: OpenStep
Description forthcoming.
- (
NSCellType)
type;
Availability: OpenStep
Returns the cell's current type identifier. The
type indicates the basic category of cell behavior and
determines the primary methods used for content
display and user interaction. This affects the
cell's rendering strategy and available
configuration options.
Returns the cell's type. Returns NSNullCellType
if the cell's type flag is set to NSImageCellType and
if the cell's image is nil. See
NSCellType
for more information.
See Also
-setType:
- (BOOL)
usesSingleLineMode;
Availability: MacOS-X 10.6.0
Description forthcoming.
- (BOOL)
wraps;
Availability: OpenStep
Returns whether the cell's text content wraps to
multiple lines when it exceeds the available
width. Wrapping cells display long
text across multiple lines within the cell's bounds,
while non-wrapping cells may truncate or scroll
content that doesn't fit horizontally.
Instance Variables for NSCell Class
@protected NSUInteger
_action_mask;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSImage*
_cell_image;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id
_contents;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSFont*
_font;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSFormatter*
_formatter;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSMenu*
_menu;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected NSUInteger
_mouse_down_flags;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id
_object_value;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id
_represented_object;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected void*
_reserved1;
Availability: OpenStep
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected struct GSCellFlagsType
struct GSCellFlagsType;
Availability: OpenStep
Description forthcoming.
- Declared in:
- AppKit/NSCell.h
Availability: OpenStep
Warning this category is private,
which means that the methods are for internal use by
the package. You should not use them in external code.
- (
NSAttributedString*)
_drawAttributedString;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Private internal method,
returns an attributed string to display.
- (void)
_drawAttributedText: (
NSAttributedString*)aString
inFrame: (
NSRect)aRect;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Private internal method
to display an attributed string.
Important: text
should always be vertically centered without
considering descender [as if descender did not
exist]. This is particularly important for single
line texts. Please make sure the output remains always
correct.
- (void)
_drawBorderAndBackgroundWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (void)
_drawEditorWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (void)
_drawFocusRingWithFrame: (
NSRect)cellFrame
inView: (
NSView*)controlView;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (void)
_drawText: (
NSString*)aString
inFrame: (
NSRect)cellFrame;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
Important: text should
always be vertically centered without considering
descender [as if descender did not exist]. This
is particularly important for single line texts. Please
make sure the output remains always correct.
- (
NSDictionary*)
_nonAutoreleasedTypingAttributes;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (BOOL)
_sendsActionOn: (
NSUInteger)eventTypeMask;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (void)
_setInEditing: (BOOL)flag;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (
NSSize)
_sizeText: (
NSString*)title;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (void)
_updateFieldEditor: (
NSText*)textObject;
Availability: OpenStep
Warning the underscore at the start of the
name of this method indicates that it is private, for
internal use only, and you should not use the
method in your code.
- (
NSColor*)
textColor;
Availability: OpenStep
Description forthcoming.
Up