# Derived from Tree.tcl in Tix 4.1
# Chris Dean <ctdean@cogit.com>
$VERSION = '3.019'; # $Id: //depot/Tk8/Tixish/Tree.pm#19 $
use base qw(Tk::Derived Tk::HList);
Construct Tk
::Widget
'Tree';
sub Tk
::Widget
::ScrlTree
{ shift->Scrolled('Tree' => @_) }
$w->SUPER::Populate
( $args );
-ignoreinvoke
=> ['PASSIVE', 'ignoreInvoke', 'IgnoreInvoke', 0],
-opencmd
=> ['CALLBACK', 'openCmd', 'OpenCmd', 'OpenCmd' ],
-indicatorcmd
=> ['CALLBACK', 'indicatorCmd', 'IndicatorCmd', 'IndicatorCmd'],
-closecmd
=> ['CALLBACK', 'closeCmd', 'CloseCmd', 'CloseCmd'],
-indicator
=> ['SELF', 'indicator', 'Indicator', 1],
-indent
=> ['SELF', 'indent', 'Indent', 20],
-width
=> ['SELF', 'width', 'Width', 20],
-itemtype
=> ['SELF', 'itemtype', 'Itemtype', 'imagetext'],
my( $w, $ent, $event ) = @_;
my $mode = $w->getmode( $ent );
$w->_indicator_image( $ent, 'plusarm' );
$w->_indicator_image( $ent, 'minusarm' );
elsif ( $event eq '<Disarm>' )
$w->_indicator_image( $ent, 'plus' );
$w->_indicator_image( $ent, 'minus' );
elsif( $event eq '<Activate>' )
$w->Activate( $ent, $mode );
$w->Callback( -browsecmd
=> $ent );
my $mode = $w->getmode( $ent );
$w->Activate( $ent, $mode ) if( $mode eq 'close' );
my $mode = $w->getmode( $ent );
$w->Activate( $ent, $mode ) if( $mode eq 'open' );
return( 'none' ) unless $w->indicatorExists( $ent );
my $img = $w->_indicator_image( $ent );
return( 'open' ) if( $img eq 'plus' || $img eq 'plusarm' );
push(@args,$ent) if defined $ent;
my @children = $w->infoChildren( @args );
foreach my $c (@children)
$mode = 'open' if $w->infoHidden( $c );
$w->_indicator_image( $ent, 'plus' );
elsif ( $mode eq 'close' )
$w->_indicator_image( $ent, 'minus' );
$w->_indicator_image( $ent, undef );
my( $w, $ent, $mode ) = @_;
$w->Callback( -opencmd
=> $ent );
$w->_indicator_image( $ent, 'minus' );
elsif ( $mode eq 'close' )
$w->Callback( -closecmd
=> $ent );
$w->_indicator_image( $ent, 'plus' );
foreach my $kid ($w->infoChildren( $ent ))
$w->show( -entry
=> $kid );
foreach my $kid ($w->infoChildren( $ent ))
$w->hide( -entry
=> $kid );
return if $w->{Configure
}{-ignoreInvoke
};
$w->Activate( $ent, $w->getmode( $ent ) ) if $w->indicatorExists( $ent );
my( $w, $ent, $image ) = @_;
my $data = $w->privateData();
$w->indicatorCreate( $ent, -itemtype
=> 'image' )
unless $w->indicatorExists($ent);
$w->indicatorConfigure( $ent, -image
=> $w->Getimage( $image ) );
$w->indicatorDelete( $ent ) if $w->indicatorExists( $ent );
# Copyright (c) 1996, Expert Interface Technologies
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# The file man.macros and some of the macros used by this file are
# copyrighted: (c) 1990 The Regents of the University of California.
# (c) 1994-1995 Sun Microsystems, Inc.
# The license terms of the Tcl/Tk distrobution are in the file