NAME

Tickit::Widget::Tree - support for an expandable tree widget

VERSION

version 0.001

SYNOPSIS

my $tree = Tickit::Widget::Tree->new(
	is_open => 1,
	last => 1,
	label => 'Root',
	line_style => 'single',
);
$tree->add(Tickit::Widget::Tree->new(
	is_open => 1,
	last => 1,
	label => 'First',
));

DESCRIPTION

Simple tree widget. See examples in main source for more info.

METHODS

new

Instantiate new tree.

Takes the following named parameters:

  • root - the root widget for this tree (optional)

  • parent - the parent widget (optional)

  • line_style - type of line used, see "LINE STYLES" (optional, defaults to single)

  • label - the text label to use for this tree entry

lines

Returns the number of lines used by this node. Will be the label height unless the widget is open.

cols

Number of cols for autocalculation. We're flexible, so we just use the default 1.

is_open

Returns true if this node is open, false if not.

window_gained

reapply_windows

insert_after

Adds $v after $self.

Takes over $self->next, including backlink from $self->next->prev.

add

rebuild

rebuild_all

children

is_highlighted

prefix_text

render

highlighted

label

highlight

prev

next

highlight_next

highlight_prev

rerender

root

parent

update_root_and_parent

on_key

open

close

child_resized

bind_keys

on_add

line_style

is_valid_tree_node

Returns 1 if this is a valid tree node, 0 if not.

A 'valid tree node' is defined as an object which is a subclass or instance of the Tickit::Widget::Tree class.

SEE ALSO

AUTHOR

Tom Molesworth <cpan@entitymodel.com>

LICENSE

Copyright Tom Molesworth 2011. Licensed under the same terms as Perl itself.