andy4321 has asked for the wisdom of the Perl Monks concerning the following question:
The code below is the smallest example I could come up with.
There are two curiosities that I'd like to figure-out.
When I single (left-click) the window not containing an entry, then the entry that was clicked returns to being displayed as DarkGreen with no highlight box round it.
Questions (somewhat inter-related):
Thank you for your time.
#!/usr/bin/perl use Tk; use Tk::HList; use Tk::ItemStyle; use File::Basename; $FONT_BOLD = "Courier 12 bold"; $mw = MainWindow->new(-title => $0); $hlist = $mw->HList(-selectmode=>"none", -selectbackground=>"Wheat", -selectborderwidth=>0, -background=>"Wheat", -selectbackground=>"Wheat", -separator=>"/", -drawbranch=>1, -indicator=>1, ) -> pack(qw/-fill both -expand yes/); $Highlight = $mw->ItemStyle('text', -foreground=>"DarkGreen", -backgro +und=>"Wheat", -font=>$FONT_BOLD); foreach $path("/", "/home", "/home/andrew") { $hlist -> add($path, -text=>basename($path), -style=>$Highlight); } MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Double-clicking a HList Entry
by choroba (Cardinal) on Mar 30, 2025 at 16:36 UTC | |
by andy4321 (Novice) on Mar 31, 2025 at 05:55 UTC |