NSCell
A mechanism for displaying text or images in a view object without the overhead of a full Nsview subclass.
Declaration
@MainActor class NSCellOverview
Cells are used by most of the NSControl classes to implement their internal workings.
Designated Initializers
When subclassing NSCell you must implement all of the designated initializers. Those methods include init(), init(coder:), init(textCell:), and init(imageCell:).
Topics
Initializing a Cell
Managing Cell Values
Managing Cell Attributes
Managing Display Attributes
Managing Cell State
Modifying Textual Attributes
isEditableisSelectableisScrollablealignmentfontlineBreakModetruncatesLastVisibleLinewrapsbaseWritingDirectionattributedStringValueallowsEditingTextAttributesimportsGraphicssetUpFieldEditorAttributes(_:)title
Managing the Target and Action
Managing the Image
Managing the Tag
Formatting and Validating Data
Managing Menus
Comparing Cells
Respond to Keyboard Events
Deriving Values
takeObjectValueFrom(_:)takeIntegerValueFrom(_:)takeIntValueFrom(_:)takeStringValueFrom(_:)takeDoubleValueFrom(_:)takeFloatValueFrom(_:)
Representing an Object
Tracking the Mouse
trackMouse(with:in:of:untilMouseUp:)startTracking(at:in:)continueTracking(last:current:in:)stopTracking(last:current:in:mouseIsUp:)mouseDownFlagsprefersTrackingUntilMouseUpgetPeriodicDelay(_:interval:)
Hit Testing
Managing the Cursor
Handling Keyboard Alternatives
Dragging Cells
Managing Focus Rings
Determining Cell Size
calcDrawInfo(_:)cellSizecellSize(forBounds:)drawingRect(forBounds:)imageRect(forBounds:)titleRect(forBounds:)controlSize
Drawing and Highlighting
draw(withFrame:in:)highlightColor(withFrame:in:)drawInterior(withFrame:in:)controlViewhighlight(_:withFrame:in:)isHighlighted
Editing and Selecting Text
edit(withFrame:in:editor:delegate:event:)select(withFrame:in:editor:delegate:start:length:)sendsActionOnEndEditingendEditing(_:)wantsNotificationForMarkedTextfieldEditor(for:)usesSingleLineMode
Managing Expansion Frames
User Interface Layout Direction
Constants
NSCell.CellTypeNSCell.AttributeNSControl.ImagePositionNSImageScalingNSCell.StateValueNSCell.StyleMaskNSControlTintNSControl.ControlSizeNSCell.HitResultNSView.BackgroundStyleDeprecated Scaling ConstantsData Entry Types