Tk-ITree

 view release on metacpan or  search on metacpan

lib/Tk/ITree.pm  view on Meta::CPAN

package Tk::ITree;
# Tree -- TixTree widget
#
# Derived from Tree.tcl in Tix 4.1
#
# Chris Dean <ctdean@cogit.com>
# Changes: Renee Baecker <module@renee-baecker.de>

=head1 NAME

Tk::ITree - Shamelessly copied Tk::Tree widget

=cut

use vars qw($VERSION);
$VERSION = '0.03';

use Tk ();
use Tk::Derived;
use Tk::HList;
use base  qw(Tk::Derived Tk::HList);
use strict;

Construct Tk::Widget 'ITree';

sub Tk::Widget::ScrlTree { shift->Scrolled('ITree' => @_) }

my $minusimg = '#define indicatorclose_width 11
#define indicatorclose_height 11
static unsigned char indicatorclose_bits[] = {
   0xff, 0x07, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0xfd, 0x05,
   0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 0xff, 0x07 };
';

my $plusimg = '#define indicatoropen_width 11
#define indicatoropen_height 11
static unsigned char indicatoropen_bits[] = {
   0xff, 0x07, 0x01, 0x04, 0x21, 0x04, 0x21, 0x04, 0x21, 0x04, 0xfd, 0x05,
   0x21, 0x04, 0x21, 0x04, 0x21, 0x04, 0x01, 0x04, 0xff, 0x07 };
';

=head1 SYNOPSIS

 require Tk::ITree;
 my $tree= $window->ITree(@options)->pack;

=head1 DESCRIPTION

B<Tk::ITree> is a an almost exact copy of L<Tk::Tree>. This one performs
a bit better under a dark desktop theme.

The reason for copying instead of inheriting is that just the method i
needed to change is a hidden one.

All cudos go to the original authors.

You can use all config variables and methods of the Tree widget.

=cut

=head1 B<CONFIG VARIABLES>

=over 4

=item Switch: B<-indicatorminusimg>

Set or get the I<minus> indicator image. By default it is set
to an internal bitmap in this package.

=item Switch: B<-indicatorplusimg>

Set or get the I<plus> indicator image. By default it is set
to an internal bitmap in this package.

=item Switch: B<-leftrightcall>

This callback is executed when the user presses the right or left arrow key.
The call gets 'left' or 'right' and the name of the selected entry as parameter.

=back



( run in 1.492 second using v1.01-cache-2.11-cpan-140bd7fdf52 )