Class

NSTabView

A multipage interface that displays one page at a time.

Declaration

@interface NSTabView : NSView

Overview

A tab view contains a row of tabs that give the appearance of folder tabs, as shown in the Figure 1. The user selects the desired page by clicking the appropriate tab or using the arrow keys to move between pages. Each page displays a view hierarchy provided by your app.

Topics

Handling the Selection of Tabs

delegate

The tab view’s delegate.

NSTabViewDelegate

The NSTabViewDelegate protocol defines the optional methods implemented by delegates of NSTabView objects.

Adding and Removing Tabs

- addTabViewItem:

Adds the specified tab item.

- insertTabViewItem:atIndex:

Inserts the specified item into the tab view’s array of tab view items at the specified index.

- removeTabViewItem:

Removes the specified item from the tab view’s array of tab view items.

Accessing Tabs

- indexOfTabViewItem:

Returns the index of the specified item in the tab view.

- indexOfTabViewItemWithIdentifier:

Returns the index of the item that matches the specified identifier or NSNotFound if the item is not found.

numberOfTabViewItems

The number of items in the tab view’s array of tab view items.

- tabViewItemAtIndex:

Returns the tab view item at index in the tab view’s array of items.

tabViewItems

The tab view’s array of tab view items.

Configuring the Tab Attributes

tabViewType

The tab type to display the tabs.

NSTabViewType

These constants specify the tab view’s type as used by the tabViewType property.

Selecting a Tab

- selectFirstTabViewItem:

This action method selects the first tab view item.

- selectLastTabViewItem:

This action method selects the last tab view item.

- selectNextTabViewItem:

This action method selects the next tab view item in the sequence.

- selectPreviousTabViewItem:

This action method selects the previous tab view item in the sequence.

- selectTabViewItem:

Selects the specified tab view item.

- selectTabViewItemAtIndex:

Selects the tab view item specified by index.

- selectTabViewItemWithIdentifier:

Selects the tab view item specified by identifier.

selectedTabViewItem

The tab view item for the currently selected tab.

- takeSelectedTabViewItemFromSender:

Sets the selected tab view item to the selected item obtained from the sender.

Modifying the Font

font

The font used for the tab view’s label text.

Modifying Controls Tint

controlTint

The tab view’s control tint.

Deprecated

Manipulating the Background

drawsBackground

A Boolean value that indicates if the tab view draws a background color when its type is NSNoTabsNoBorder.

Determining the Size

minimumSize

The minimum size necessary for the tab view to display tabs in a useful way.

contentRect

The rectangle describing the content area of the tab view.

controlSize

The size of the tab view.

Truncating Tab Labels

allowsTruncatedLabels

A Boolean value that indicates if the tab view allows truncating for labels that don’t fit on a tab.

Event Handling

- tabViewItemAtPoint:

Returns the tab view item at the specified point.

Relationships

Inherits From

See Also

Tab View Interface

NSTabViewController

A container view controller that manages a tab view interface, which organizes multiple pages of content but displays only one page at a time.

NSTabViewItem

An item in a tab view.