Haiku API Bindings
Tab
Not logged in

Documentation | InterfaceKit | Tab

SYNOPSIS

Perl

use HaikuR1::Tab qw(B_TAB_FIRST B_TAB_FRONT B_TAB_ANY);

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

my $tab = HaikuR1::Tab->new();
$tabview->AddTab($content_view, $tab);

Python

from HaikuR1.InterfaceKit import TabView, Tab, B_TAB_FIRST, B_TAB_FRONT, B_TAB_ANY

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

tab = Tab
tabview.AddTab(content_view, tab)

DESCRIPTION

Exposes the BTab object.

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

METHODS

Constructor

Creates a Tab.

Unless you are creating your own custom Tab subclass, you do not need to create your own Tab; TabView.AddTab will create a standard Tab for you.

Perl

HaikuR1::Tab->new($tabView);
HaikuR1::Tab->new($archive);

Python

Tab(tabView)
Tab(archive)

Enabled state

IsEnabled

SetEnabled

Enables or disables the Tab.

Perl

$tab->IsEnabled();
$tab->SetEnabled($enabled);

Python

tab.IsEnabled()
tab.SetEnabled(enabled)

Focus

MakeFocus

IsFocus

...

Perl

$tab->MakeFocus($focused);
$tab->IsFocus();

Python

tab.MakeFocus(focused)
tab.IsFocus()

Label

SetLabel

Gets or sets the label. SetLabel can also be called as a hook.

The Tab's label is the name of its View. Setting the label will also change the View's name.

Perl

$tab->Label();
$tab->SetLabel($label);

Python

tab.Label()
tab.SetLabel(label)

Select

Deselect

IsSelected

Selects or deslects the Tab. Select and Deselct can also be called as hooks.

Perl

$tab->Select($owner);
$tab->Deselect();
$tab->IsSelected();

Python

tab.Select(owner)
tab.Deselect()
tab.IsSelected()

View

SetView

Gets or sets the Tab's content View. SetView can also be called as a hook.

Perl

$tab->View();
$tab->SetView($view);

Python

tab.View()
tab.SetView(view)

HOOKS

DrawFocusMark

Called to draw the foxus mark on the focus Tab.

Perl

$tab->DrawFocusMark($owner, $frame);

Python

tab.DrawFocusMark(owner, frame)

DrawLabel

Called to draw the Tab's label.

Perl

$tab->DrawLabel($owner, $frame);

Python

tab.DrawLabel(owner, frame)

DrawTab

Called to draw the Tab.

Perl

$tab->DrawTab(
    owner => $owner,
    frame => $frame,
    position => $position,
    full => $full,
);

Python

tab.DrawTab(
    owner = owner,
    frame = frame,
    position = position,
    full = full,
)

ARCHIVABLE INTERFACE

TabView inherits the methods and hooks of Archivable.

CONSTANTS

Tab position

Perl

use HaikuR1::TabView qw(:tab_position)

Python

Python does not support export tags.