rjohn1 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
In the below code, if the user clicks on APPLE(which will be displayed) under ONE, i need to know the path 'one.apple' This is currently possible but only with double-click(using -command). How can i change this binding to single click?
Quoting from HList in CPAN-> Switch: -command Specifies the perl/Tk callback to be executed when the user invokes a list entry in the HList widget. Normally the user invokes a list entry by double-clicking it or pressing the Return key.
Thanks RJuse Tk; use Tk::HList; my $mw = MainWindow->new(-title=>'HList'); my $hlist = $mw->HList->pack; foreach(qw/one two three one.apple two.grapes three.apple/){ my $path = $_; (my $display_entry = $_) =~ s/.*\.//; my $uc_entry = uc($display_entry); $hlist->add($_, -text => $uc_entry); } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to bind single click to get an path of an entry in Tk::HList
by kcott (Archbishop) on Apr 17, 2014 at 22:58 UTC | |
by rjohn1 (Sexton) on Apr 18, 2014 at 04:06 UTC | |
by kcott (Archbishop) on Apr 18, 2014 at 05:04 UTC | |
by rjohn1 (Sexton) on Apr 18, 2014 at 14:39 UTC | |
by kcott (Archbishop) on Apr 18, 2014 at 21:15 UTC | |
|
Re: How to bind single click to get an path of an entry in Tk::HList
by zentara (Cardinal) on Apr 18, 2014 at 09:13 UTC |