use Gtk2 -init; use Forest::Tree; use Forest::Tree::Viewer::Gtk2; my $tree = Forest::Tree->new(node=>'root',children=>[ Forest::Tree->new(node=>'child1'), Forest::Tree->new(node=>'child2'), ]); my $viewer = Forest::Tree::Viewer::Gtk2->new(tree=>$tree); # wrap the tree view in a simple gtk2 application my $window = Gtk2::Window->new('toplevel'); $window->add($viewer->view); $window->show_all; Gtk2->main;
Forest::Tree::Viewer::Gtk2 - a simple Gtk2 using tree viewer
The tree we want to display
Return the Gtk2::TreeView for our tree
Return the Gtk2::TreeStore for our tree
To install Forest::Tree::Viewer::Gtk2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Forest::Tree::Viewer::Gtk2
CPAN shell
perl -MCPAN -e shell install Forest::Tree::Viewer::Gtk2
For more information on module installation, please visit the detailed CPAN module installation guide.