Tickit::Widget::Tree - tree widget implementation for Tickit
use Tickit::Widget::Tree; my $tree = Tickit::Widget::Tree->new(root => Tree::DAG_Node->new);
NOTE: Versions 0.003 and below used a custom graph management implementation which had various problems with rendering glitches and performance. This version has been rewritten from scratch to use Tree::DAG_Node to handle the tree structure, and as such is not backward compatible.
The following style keys are recognised, in addition to base styling which will be applied to the tree lines:
Key bindings are currently:
Calculate the minimum size needed to contain the full tree with all nodes expanded.
Instantiate. Takes the following named parameters:
Accessor for the root node. If given a parameter, will set the root node accordingly (and mark the tree for redraw), returning $self.
Otherwise, returns the root node - or undef if we do not have one.
Work out our size, when we have a window to fit in.
Called by Tickit::Widget::ScrollBox or other scroll-capable containers to set up the extent objects which determine the drawable viewport offset.
Called by Tickit::Widget::ScrollBox or other scroll-capable containers to indicate when scroll actions have occurred.
Render method. Used internally.
Workaround to avoid warnings from Tickit::Window. This probably shouldn't be here, pretend you didn't see it.
Mouse callback. Used internally.
Jump to the first row. Normally bound to the
Jump to the last row. Normally bound to the
Go up a node.
Move down a node.
Going "up" the tree means the parent of the current node.
Going "down" the tree means the first child node, if we have one and we're open.
Change the currently highlighted node.
Open this node.
Close this node.
on_activate coderef if we have it.
Plenty of features and bugfixes left on the list, in no particular order:
get_style_pen, get_style_text, get_style_values, key_focus_next_after, key_focus_next_before, on_pen_changed, parent, pen, redraw, resized, set_parent, set_pen, set_style, set_style_tag, set_window, style_classes, take_focus, window, window_lost
Tom Molesworth <firstname.lastname@example.org>
Copyright Tom Molesworth 2011-2013. Licensed under the same terms as Perl itself.