the above code is printing the line number and character no is ok. but I used in Scrolled widget that output is not printing. what is the problem in the following code how can I solve this?my $c=0; my $r=0; $txt = $mw->Text( -background =>'white', -width=>400, -height=>300, -selectbackground => 'skyblue', -insertwidth => 5, -borderwidth =>3, -highlightcolor => 'blue', ### after vis +it -highlightbackground => 'red' , ### default b +efore visit -xscrollcommand => sub { print"CHAT NO :",$c++; }, # Determines the callback used when the Text widget is scrolled + horizontally. -yscrollcommand => sub { print"LINR NO:",$r++; }, # Determines the callback used when the Text widget is scrolled + vertically. -padx => 5, -pady => 5, )-> pack ();
$txt = $mw->Scrolled('Text', -scrollbars => 'se', -background =>'white', -width=>400, -height=>300, -insertwidth => 5, -borderwidth =>3, -highlightcolor => 'blue', ### after visit -highlightbackground => 'red' , ### default before + visit -padx => 5, -pady => 5, -xscrollcommand => sub { print"CHAT NO :",$c++; }, # Determines the callback used when the Text widget is scrolle +d horizontally. -yscrollcommand => sub { print"LINR NO :",$r++; }, # Determines the callback used when the Text widget is scrolle +d vertically. )->pack();
In reply to [PERL Tk] printing Line number in Text widget. by ungalnanban
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |