Hello,everyone:
<<How to be in the following code rolling display data (real time)?
use Tk; my $mw = new MainWindow; # Main Window my $frm_name = $mw -> Frame(); my $lab = $frm_name -> Label(-text=>"IP:"); my $ent = $frm_name -> Entry(); my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button); my $textarea = $mw -> Frame(); #Creating Another Frame my $txt = $textarea -> Text(-width=>40, -height=>10); my $srl_y = $textarea -> Scrollbar(-orient=>'v',-command=>[yview => $t +xt]); my $srl_x = $textarea -> Scrollbar(-orient=>'h',-command=>[xview => $t +xt]); $txt -> configure(-yscrollcommand=>['set', $srl_y], -xscrollcommand=>['set',$srl_x]); $lab -> grid(-row=>1,-column=>1); $ent -> grid(-row=>1,-column=>2); $frm_name -> grid(-row=>1,-column=>1,-columnspan=>2); $but -> grid(-row=>4,-column=>1,-columnspan=>2); $txt -> grid(-row=>1,-column=>1); $srl_y -> grid(-row=>1,-column=>2,-sticky=>"ns"); $srl_x -> grid(-row=>2,-column=>1,-sticky=>"ew"); $textarea -> grid(-row=>5,-column=>1,-columnspan=>2); MainLoop; #This function will be executed when the button is pushed sub push_button { my $ip = $ent -> get(); my $ping = `ping $ip`; $txt -> insert('end', "$ping");#Here is not the results of real-time d +isplay }
Here to run the results without scrolling display, how to modify?
Thanks!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |