Inherits From:
NSObject
Conforms To:
NSCoding
NSObject (NSObject)
Declared In:
AppKit/NSTabViewItem.h
An NSTabView provides a convenient mechanism for presenting information in a multi-page format. A tab view is usually distinguished by a row of tabs that give the visual appearance of folder tabs. When the user clicks on a tab, the tab view displays a view page provided by your application.
A tab view keeps a zero-based array of NSTabViewItems, one for each tab in the view. A tab view item provides access to the tab's color, state, label text, initial first responder, and associated view. Your application can supply each tab view item with an optional identifier object to customize tab handling.
color
Returns the color for the tab view item. By default, the color is set to the system color used for the flat surfaces of a control.
See also:
- setColor:
drawLabel:
(BOOL)shouldTruncateLabel inRect:(
NSRect)tabRect
If shouldTruncateLabel is NO, draws the full label in the rect specified by tabRect. If shouldTruncateLabel is YES, draws the truncated label. You can override this method to perform customized label drawing. For example, you might want to add an icon to each tab in the view.
See also:
- sizeOfLabel:
identifier
Returns the tab view item's optional identifier object. To customize how your application works with tabs, you can initialize each tab view item with an identifier object.
See also:
- initWithIdentifier:
, - setIdentifier:
initialFirstResponder
Returns the id
for the initial first responder for the view associated with the tab view item.
See also:
- setInitialFirstResponder:
initWithIdentifier:
(id)identifier
Performs default initialization for the tab view item. Sets the item's identifier object to identifier, if it is not nil
. Use this method when creating tab view items programmatically.
See also:
- identifier
, - setIdentifier:
label
Returns the label text for the tab view item.
See also:
- setLabel:
setColor:
(NSColor *)color
Sets the color for the tab view item to color.
See also:
- color
setIdentifier:
(id)identifier
Sets the tab view item's optional identifier object to identifier. To customize how your application works with tabs, you can specify an identifier object for each tab view item.
See also:
- identifier
, - initWithIdentifier:
setInitialFirstResponder:
(NSView *)view
Sets the initial first responder for the view associated with the tab view item (the view that is displayed when a user clicks on the tab) to view.
See also:
- initialFirstResponder
setLabel:
(NSString *)label
Sets the label text for the tab view item according to the passed string label.
See also:
- label
setView:
(NSView *)view
Sets the view associated with the tab view item to view. This is the view that is displayed when a user clicks on the tab. When you set a new view, the old view is released.
See also:
- view
sizeOfLabel:
(BOOL)shouldTruncateLabel
If shouldTruncateLabel is NO, returns the size of the tab view item's full label. If shouldTruncateLabel is YES, returns the truncated size. If your application does anything to change the size of tab labels, such as overriding the drawLabel:inRect:
method to add an icon to each tab, you should override sizeOfLabel:
too so that the NSTabView knows the correct size for the tab label.
See also:
- drawLabel:inRect:
, - setFont:
(NSTabView)
tabState
Returns the current display state of the tab associated with this tab view item. The possible values are NSSelectedTab, NSBackgroundTab, or NSPressedTab. Your application does not directly set the tab state.
tabView
Returns the parent tab view for the tab view item. Note that this is the tab view itself, not the view that is displayed when a user clicks on the tab.
A tab view item normally learns about its parent tab view when it is inserted into the view's array of items. The NSTabView methods addTabViewItem:
and insertTabViewItem:atIndex:
set the tab view for the added or inserted item.
See also:
- setView:
, - view
view
Returns the id
for the view associated with the tab view item. This is the view that is displayed when a user clicks on the tab.
See also:
- setView: