NSTableRowView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.7 and later. |
| Declared in | NSTableRowView.h |
| Companion guides | |
Overview
The NSTableRowView class is the view shown for a row in an NSTableView. It is responsible for displaying attributes associated with the row, including the selection highlight, and group row look.
Tasks
Display Style
-
emphasizedproperty -
interiorBackgroundStyleproperty -
floatingproperty
Row Selection
-
selectedproperty -
selectionHighlightStyleproperty
Drag and Drop
-
draggingDestinationFeedbackStyleproperty -
indentationForDropOperationproperty -
targetForDropOperationproperty
Row Grouping
-
groupRowStyleproperty -
numberOfColumnsproperty
Overriding Row View Display Characteristics
-
backgroundColorproperty -
– drawBackgroundInRect: -
– drawDraggingDestinationFeedbackInRect: -
– drawSelectionInRect: -
– drawSeparatorInRect:
Accessing A Row Column View
Properties
backgroundColor
The background color of the row.
Discussion
The property defaults to the table view’s backgroundColor, unless usesAlternatingRowBackgroundColors is set to YES. In that case, the colors alternate, and are automatically updated as required by insertions and deletions.
The value of the background color can be customized in the NSTableViewDelegate method tableView:didAddRowView:forRow:. The property is animatable.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hdraggingDestinationFeedbackStyle
Specifies the dragging destination feedback style.
Discussion
Possible values are defined in NSTableViewDraggingDestinationFeedbackStyle.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hemphasized
Determines whether the row will draw with the alternate or secondary color (unless overridden).
Discussion
When emphasized is YES, the view will draw with the alternateSelectedControlColor defined by NSColor. When NO it will use the secondarySelectedControlColor defined by NSColor.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hfloating
Specifies whether the row is drawn using the floating style.
Discussion
Floating is a temporary attribute that is set when a particular group row is actually floating above other rows. The state may change dynamically based on the position of the group row. Drawing may be different for rows that are currently 'floating'.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hgroupRowStyle
Specifies whether this row view is a group row.
Discussion
When YES this row is a group row and will draw appropriately.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hindentationForDropOperation
Defines the amount the drag target for a row should be indented.
Discussion
The default is 0.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hinteriorBackgroundStyle
Specifies how the subviews should draw. (read-only)
Discussion
This value is dynamically computed based on the set of properties set for the NSTableRowView.
Subclassers can override this value when they draw differently based on the currently displayed properties.
This property can also be set to determine the color a subview should use. See NSBackgroundStyle for supported values.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hnumberOfColumns
Returns the number of columns represented by views in the table row view. (read-only)
Discussion
The number of columns may not be equal to the number of columns in the enclosing NSTableView, if this row view is a group style and has a single view that spans the entire width of the row.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hselected
Determines whether the row is selected.
Discussion
YES if selected, otherwise NO.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hselectionHighlightStyle
Specifies the selection highlight style.
Discussion
The possible values are specified in NSTableViewSelectionHighlightStyle in NSTableView Class Reference.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.htargetForDropOperation
Specifies whether this row will draw a drop indicator based on the current dragging feedback style.
Discussion
When YES, the row view will draw a drop on indicator based on the current draggingDestinationFeedbackStyle.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hInstance Methods
drawBackgroundInRect:
Draws the background of the row in the rectangle.
Parameters
- dirtyRect
The rectangle that requires drawing.
Discussion
Overriding this method allows an application to draw a custom background for a table row view.
By default, this method draws the background color or group row style as appropriate for the row. This method also draws the “below look” for a drop target if targetForDropOperation is YES.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hdrawDraggingDestinationFeedbackInRect:
Draws the row’s dragging destination feedback when the entire row is a drop target.
Parameters
- dirtyRect
The rectangle that requires drawing.
Discussion
Overriding this method allows an application to draw custom dragging destination feedback when the entire row is a drop target.
This method only is called if targetForDropOperation is YES, and is only drawn based on the properties set, such as the group row style.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hdrawSelectionInRect:
Draws the selected row.
Parameters
- dirtyRect
The rectangle that requires drawing.
Discussion
This method is only called if the selection should be drawn.
The selection will automatically be alpha-blended if the selection is animating in or out.
The default selection drawn is dependent on the selectionHighlightStyle.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hdrawSeparatorInRect:
Draws the horizontal separator between table rows.
Parameters
- dirtyRect
The rectangle that requires drawing.
Discussion
By default, the separator is only drawn if the enclosing table's gridStyleMask is set to include a horizontal separator.
The separator should be drawn at the bottom of the row view, indicating a separation from this row and the next.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.hviewAtColumn:
Provides access to the given view at a particular column.
Parameters
- column
The index of the column.
Return Value
The view for the specified column.
Discussion
This is the only way to access cell views after the row view has been removed from the table.
Availability
- Available in OS X v10.7 and later.
Declared In
NSTableRowView.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-06-06)