Haiku API Bindings
ListItem
Not logged in

Documentation | InterfaceKit | ListItem

SYNOPSIS

Perl

use HaikuR1::ListItem;

# define MyListItem subclass here

my $item = MyListItem->new();
$listview->AddItem($item);

Python

from HaikuR1.SupportKit import ListItem

# define MyListItem subclass here

item = MyListItem()
listview.AddItem(item)

DESCRIPTION

Exposes the BListItem object.

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

METHODS

Constructor

Creates a ListItem.

Perl

HaikuR1::ListItem->new($outlineLevel, $expanded);
HaikuR1::ListItem->new($archive);

Python

ListItem(outlineLevel, expanded)
ListItem(archive)

Height

SetHeight

These methods do what you expect.

Perl

$listitem->Height();
$listitem->SetHeight($height);

Python

listitem.Height()
listitem.SetHeight(height)

Width

SetWidth

These methods do what you expect.

Perl

$listitem->Width();
$listitem->SetWidth($width);

Python

listitem.Width()
listitem.SetWidth(width)

Select

Deselect

IsSelected

These methods do what you expect.

Perl

$listitem->Select();
$listitem->Deselect();
$listitem->IsSelected();

Python

listitem.Select()
listitem.Deselect()
listitem.IsSelected()

Enabled state

SetEnabled

IsEnabled

These methods do what you expect. SetEnabled can also be called as a hook.

Perl

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

Python

listitem.SetEnabled(enabled)
listitem.IsEnabled()

Expanded state

SetExpanded

IsExpanded

These methods do what you expect. Used for items in an OutlineListView.

Perl

$listitem->SetExpanded($expanded);
$listitem->IsExpanded();

Python

listitem.SetExpanded(expanded)
listitem.IsExpanded()

OutlineLevel

SetOutlineLevel

These methods do what you expect. Used for items in an OutlineListView.

Perl

$listitem->OutlineLevel();
$listitem->SetOutlineLevel($level);

Python

listitem.OutlineLevel()
listitem.SetOutlineLevel(level)

HOOKS

DrawItem

Called when the item needs to be drawn. ListItem does not provide a default version, so subclasses must provide this method.

Perl

$listitem->DrawItem($owner, $frame, $complete);

Python

listitem.DrawItem(owner, frame, complete)

Update

Called when the owning View's state changes in a way that affects the item, including when the item is added to the View. The default version sets the width to the owner's width and the height so it will fit the owner's Font.

Perl

$listitem->Update($owner, $font);

Python

listitem.Update(owner, font)

ARCHIVABLE INTERFACE

ListItem inherits the methods and hooks of Archivable.