aboutsummaryrefslogtreecommitdiff
path: root/Perl/Zinc/Debug.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Perl/Zinc/Debug.pm')
-rw-r--r--Perl/Zinc/Debug.pm34
1 files changed, 28 insertions, 6 deletions
diff --git a/Perl/Zinc/Debug.pm b/Perl/Zinc/Debug.pm
index 49b0835..64c155e 100644
--- a/Perl/Zinc/Debug.pm
+++ b/Perl/Zinc/Debug.pm
@@ -13,6 +13,7 @@ use vars qw(@ISA @EXPORT);
use Carp;
require Exporter;
use File::Basename;
+use Tk;
use Tk::Zinc;
use Tk::LabFrame;
use Tk::Pane;
@@ -230,12 +231,33 @@ sub showtree {
&showresult("", $zinc, $item);
},
);
- $tree->configure(-browsecmd => sub { my $path = shift;
- my $item = (split(/\./, $path))[-1];
- &surrounditem($zinc, $item);
- },
- );
-
+ $tree->bind('<1>', [sub {
+ my $path = $tree->nearest($_[1]);
+ my $item = (split(/\./, $path))[-1];
+ &highlightitem($tree, $zinc, $item, 0);
+
+ }, Ev('y')]);
+
+ $tree->bind('<2>', [sub {
+ my $path = $tree->nearest($_[1]);
+ $tree->selectionClear;
+ $tree->selectionSet($path);
+ $tree->anchorSet($path);
+ my $item = (split(/\./, $path))[-1];
+ &highlightitem($tree, $zinc, $item, 1);
+
+ }, Ev('y')]);
+
+ $tree->bind('<3>', [sub {
+ my $path = $tree->nearest($_[1]);
+ $tree->selectionClear;
+ $tree->selectionSet($path);
+ $tree->anchorSet($path);
+ my $item = (split(/\./, $path))[-1];
+ &highlightitem($tree, $zinc, $item, 2);
+
+ }, Ev('y')]);
+
$tree->pack(-padx => 10, -pady => 10,
-ipadx => 10,
-fill => 'both',