CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Perl/Tk: Clearing Widgets Inside a Frame

 



Claude2005
Novice

Aug 4, 2011, 6:00 PM

Post #1 of 2 (1124 views)
Perl/Tk: Clearing Widgets Inside a Frame Can't Post

Hello there,

I was wondering if there's a way to clear widgets inside a frame. I intend to put the code inside the ClearAll subroutine.


Code
use strict; 
use Tk;
my $mw = MainWindow -> new;
my $f = $mw -> Frame() -> pack();
for (1..5) {
$f -> Label ( -text => $_ ) -> pack();
}
$f = $mw -> Button ( -text => 'Clear', -command => \&ClearAll )
-> pack();
MainLoop;

sub ClearAll {

}


Thanks in advance


(This post was edited by Claude2005 on Aug 4, 2011, 6:01 PM)


wickedxter
User

Aug 31, 2011, 6:25 PM

Post #2 of 2 (1035 views)
Re: [Claude2005] Perl/Tk: Clearing Widgets Inside a Frame [In reply to] Can't Post

 
you can clear widgets just tie a -variable to it, b/c it gets set to the value of the widget so if you alter the state of that variable it will change whats soon after you do an update...

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives