Haiku API Bindings
TabView
Not logged in

Documentation | InterfaceKit | TabView

SYNOPSIS

Perl

use HaikuR1::TabView;

my $tabview = HaikuR1::TabView->new(
    frame => $frame,
    name => $name,
    width => $width,
    resizingMode => $resizingMode,
    flags => $flags,
);
$window->AddChild($tabview);

Python

from HaikuR1.InterfaceKit import TabView

tabview = TabView(
    frame = frame,
    name = name,
    width = width,
    resizingMode = resizingMode,
    flags = flags,
)
window.AddChild(tabview)

DESCRIPTION

Exposes the BTabView object.

For more information on TabView, see the Be Book class description, the Be Book overview, and the Haiku Book class description.

METHODS

Constructor

Creates a TabView.

Perl

HaikuR1::TabView->new(
    frame => $frame,
    name => $name,
    width => $width,
    resizingMode => $resizingMode,
    flags => $flags,
);
HaikuR1::TabView->new($archive);

Python

TabView(
    frame = frame,
    name = name,
    width = width,
    resizingMode = resizingMode,
    flags = flags,
)
TabView(archive)

Border

SetBorder

Gets or sets the border style. SetBorder can also be called as a hook.

Perl

$tabview->Border();
$tabview->SetBorder($style);

Python

tabview.Border()
tabview.SetBorder(style)

FocusTab

SetFocusTab

Gets or sets the focus tab. SetFocusTab can also be called as a hook.

Perl

$tabview->FocusTab();
$tabview->SetFocusTab($tab);

Python

tabview.FocusTab()
tabview.SetFocusTab(tab)

Select

Selection

Gets or sets the selected tab. Select can also be called as a hook.

Perl

$tabview->Select($tab);
$tabview->Selection();

Python

tabview.Select(tab)
tabview.Selection()

Tab maintenance

AddTab

RemoveTab

TabAt

CountTabs

TabFrame

These methods do what you expect. AddTab, RemoveTab, TabAt, and TabFrame can also be called as hooks.

Perl

$tabview->AddTab($target, $tab);
$tabview->RemoveTab($index);
$tabview->TabAt($index);
$tabview->CountTabs();
$tabview->TabFrame($index);

Python

tabview.AddTab(target, tab)
tabview.RemoveTab(index)
tabview.TabAt(index)
tabview.CountTabs()
tabview.TabFrame(index)

TabSide

SetTabSide

Gets or sets the tab side. SetTabSide can also be called as a hook.

Perl

$tabview->TabSide();
$tabview->SetTabSide($tabSide);

Python

tabview.TabSide()
tabview.SetTabSide(tabSide)

Tab size

TabWidth

SetTabWidth

TabHeight

SetTabHeight

Gets or sets the size of the tabs. SetTabWidth and SetTabHeight can also be called as hooks.

Perl

$tabview->TabWidth();
$tabview->SetTabWidth($width);
$tabview->TabHeight();
$tabview->SetTabHeight($height);

Python

tabview.TabWidth()
tabview.SetTabWidth(width)
tabview.SetTabHeight(height)
tabview.TabHeight()

Views

ContainerView

ViewForTab

Each Tab controls a View; these Views are not owned directly by the TabView, but by a container View instead.

Perl

$tabview->ContainerView();
$tabview->ViewForTab($tabIndex);

Python

tabview.ContainerView()
tabview.ViewForTab(tabIndex)

HOOKS

DrawBox

Called to draw a box around the container View.

Perl

$tabview->DrawBox($selectedTabRect);

Python

tabview.DrawBox(selectedTabRect)

DrawTabs

Called when the TabView needs to draw its Tabs. It should return the frame rectangle of the currently selected Tab, which is then passed to DrawBox.

Perl

$tabview->DrawTabs();

Python

tabview.DrawTabs()

ARCHIVABLE INTERFACE

TabView inherits the methods and hooks of Archivable.

HANDLER INTERFACE

TabView inherits the methods and hooks of Handler.

VIEW INTERFACE

TabView inherits the methods and hooks of View.

CONSTANTS

Tab side

Perl

use HaikuR1::TabView qw(:tab_side)

Python

Python does not support export tags.

SCRIPTING SUITE

The name of TabView's scripting suite is suite/vnd.Be-tab-view.

TabView also inherits the following suites: