KalistoGatsby has asked for the wisdom of the Perl Monks concerning the following question:
How do I always keep the scrollbar at the bottom? I want the user to always see the newest text in the TextViewer. I have found the following in the documentation:my $infodialog = $infowin->add( 'infodialog', 'TextViewer', -wrapping => 1, -vscrollbar => 'right', ); $infodialog->focus(); sub info{ my ($infoText, $infodialog) = @_; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $fqInfoText = "[$hour:$min:$sec]-" . $infoText; my $currentText = $infodialog->get(); $infodialog->text($currentText . $fqInfoText); $infodialog->draw(); }
"<end> Call the 'cursor-end' routine: go to the end of the text."
Can I "send" a fake key press of the end key before I call draw to update the Textviewer to show the newest entries? How is this usually done?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Curses and TextEditors
by keszler (Priest) on Oct 19, 2013 at 08:41 UTC | |
Re: Curses and TextEditors
by kcott (Archbishop) on Oct 19, 2013 at 08:08 UTC |