Eric Hansen wrote:
Hello,
But I still don't see a Double CLick event for TreeView nodes. This is
greatly needed.
How about this:
#!perl -w
use strict;
use warnings;
use Win32::GUI;
my $mw = Win32::GUI::Window->new(
-title => "terminate test",
-pos => [100,100],
-size => [400,300],
);
my $tv = $mw->AddTreeView(
-size => [100,100],
-lines => 1,
-rootlines => 1,
-buttons => 1,
-checkboxes => 0,
-onMouseDblClick => \&tvDblClick,
);
my $root = $tv->InsertItem(
-text => "Parent",
-indent => 1,
);
$tv->InsertItem(
-parent => $root,
-text => "Child 1"
);
$tv->InsertItem(
-parent => $root,
-text => "Child 2"
);
$mw->Show();
Win32::GUI::Dialog();
exit(0);
sub tvDblClick
{
my ($self, $x, $y) = @_; # x,y in client co-ordinates
my $node = $self->HitTest($x,$y);
if($node != 0) {
my %info = $self->GetItem($node);
print "Mouse Dbl Click ($node: $info{-text})\n";
}
return;
}
__END__
Regards,
Rob.
--
Robert May
Win32::GUI, a perl extension for native Win32 applications
http://perl-win32-gui.sourceforge.net/