TabsControlDataSource

Undocumented

  • Returns the number of tabs

    Declaration

    Swift

    func tabsControlNumberOfTabs(_ control: TabsControl) -> Int

    Parameters

    control

    The instance of the tabs control.

    Return Value

    A unsigned integer indicating the number of tabs to display.

  • Return the item for the tab at the given index, similarly to a representedObject in a cell view.

    Declaration

    Swift

    func tabsControl(_ control: TabsControl, itemAtIndex index: Int) -> AnyObject

    Parameters

    control

    The instance of the tabs control.

    index

    The index of the given item.

    Return Value

    An instance of an object representing the tab.

  • Return the title for the tab of the given item

    Declaration

    Swift

    func tabsControl(_ control: TabsControl, titleForItem item: AnyObject) -> String

    Parameters

    control

    The instance of the tabs control.

    item

    The item representing the given tab.

    Return Value

    A string to be used as title of the tab.

  • If any, returns a menu for the tab, to be place to the right side of it. It is your responsability to fully configure its targets and actions before returning it to the tabs control.

    Declaration

    Swift

    @objc optional func tabsControl(_ control: TabsControl, menuForItem item:AnyObject) -> NSMenu?

    Parameters

    control

    The instance of the tabs control.

    item

    The item representing the given tab.

    Return Value

    A menu instance.

  • If any, returns an icon for the tab, to be placed to the left side of it.

    Declaration

    Swift

    @objc optional func tabsControl(_ control: TabsControl, iconForItem item:AnyObject) -> NSImage?

    Parameters

    control

    The instance of the tabs control.

    item

    The item representing the given tab.

    Return Value

    An image instance for the icon.

  • If the width of the tab is not large enough to draw the title, it is possible to provide here an alternate icon to replace it. The threshold at which one switch between the title and the icon is computed individually for each title.

    Declaration

    Swift

    @objc optional func tabsControl(_ control: TabsControl, titleAlternativeIconForItem item:AnyObject) -> NSImage?

    Parameters

    control

    The instance of the tabs control.

    item

    The item representing the given tab.

    Return Value

    An image instance for the alternate icon.