NAME

Tk::DataTree - A tree widget for arbitrary data structures

SYNOPSIS

use Tk;
use Tk::DataTree;

$mw = new MainWindow;
$dt = $mw->DataTree;

$dt->data( { foo => 1, bar => [2, 3] } );

DESCRIPTION

The Tk::DataTree class is a derivate of Tk::Tree intended for displaying arbitrary data structures. It's a bit like having Data::Dumper as a Tk widget.

WIDGET-SPECIFIC OPTIONS

-typename

If the data structure is an array or hash, this is the label of the root node.

-data

Configuring this option is equivalent to calling the data method.

-activecolor

The color that is used for changing (active) items. An item is considered active if it is new or it has changed its value since the last data call.

-undefcolor

The color that is used for items whose value is undef.

ADVERTISED WIDGETS

nodestyle

A Tk::ItemStyle object that allows you to configure the appearance of the node tree items.

normalstyle

A Tk::ItemStyle object that allows you to configure the appearance of the normal tree items.

activestyle

A Tk::ItemStyle object that allows you to configure the appearance of the active tree items.

undefstyle

A Tk::ItemStyle object that allows you to configure the appearance of the undefined tree items.

METHODS

data

The data method is the core part of the class. Just pass it any kind of perl data structure, and it will be visualized in the tree. You can call data multiple times, and the tree will always be updated according to the new data structure. Changing (active) values will be highlighted with each data call.

BUGS

I'm sure there are still lots of bugs in the code for this module. If you find any bugs, Tk::DataTree doesn't seem to build on your system or any of its tests fail, please use the CPAN Request Tracker at http://rt.cpan.org/ to create a ticket for the module. Alternatively, just send a mail to <mhx@cpan.org>.

COPYRIGHT

Copyright (c) 2004-2008 Marcus Holland-Moritz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

See Tk, Tk::Tree, Tk::DItem and Data::Dumper.