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)
tabView
A View, the Tab's content view. Since TabView.AddTab requires a View to be passed anyway, it is often easiest to just omit this parameter.
archive
A Message, contains an archived version of the Tab.
Enabled state
IsEnabled
SetEnabled
Enables or disables the Tab.
Perl
$tab->IsEnabled(); $tab->SetEnabled($enabled);
Python
tab.IsEnabled() tab.SetEnabled(enabled)
enabled
A boolean, the new enabled state.
Focus
MakeFocus
IsFocus
...
Perl
$tab->MakeFocus($focused); $tab->IsFocus();
Python
tab.MakeFocus(focused) tab.IsFocus()
focused
A boolean, the new focused state; defaults to true.
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)
label
A string, the new 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()
owner
The View that owns the Tab. (
Select
andDeselect
are usually called by a TabView, and this is its container View.)
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)
view
The new content 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, )
owner
frame
The Tab's frame Rect.
position
An integer, one of the tab position constants.
full
A boolean; if true, the full tab needs to drawn; if false, the right side of the Tab is being obscured by its neighbor to the left.
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.
B_TAB_FIRST
The first Tab, index 0.
B_TAB_FRONT
The frontmost (i.e., selected) Tab.
B_TAB_ANY
Any other Tab.