unknown-monk has asked for the wisdom of the Perl Monks concerning the following question:
When I push the SHOW button, it's relief stays sunken and the listbox (lb2) empty.#!/usr/bin/perl -w use Tk; my $mw =MainWindow ->new; $mw -> title ("Untitled"); $mw -> Button(-text => "S H O W", -command => \&show)->grid(-row => 0, + -column => 0); $mw -> Button(-text => "E X I T", -command => sub {exit})->grid(-row = +> 0, -column => 1); $lb2 = $mw -> Scrolled('Listbox', -width=> 30, -height => 10, -selectm +ode => "single", -scrollbars => 'e', -setgrid =>1, -background => 'bl +ack', -foreground => 'white') -> grid (-row => 1, -column => 0); MainLoop; sub show { $lb2 -> delete(0,'end'); open(PIPE, "du -a 2>&1 |") or die "Could not open pipe: $!\n" ; while (<PIPE>) { chop ($_) ; $lb2 -> insert('end',$_); } close(PIPE) ; } exit (0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl/Tk: How to "release" a button immediately after it's pushed?
by almut (Canon) on Apr 27, 2010 at 14:12 UTC | |
by unknown-monk (Novice) on Apr 27, 2010 at 14:49 UTC | |
|
Re: perl/Tk: How to "release" a button immediately after it's pushed?
by roboticus (Chancellor) on Apr 27, 2010 at 14:16 UTC |