in reply to Re^6: How to perform a subroutine run in cpan Tk::ExecuteCommand module
in thread How to perform a subroutine run in cpan Tk::ExecuteCommand module
I could not find a widget that does what you ask, but
Try [meatacpan://Tk::Text]
I think something like:
sub do_something { ... } sub do_something_else { ... } my $result = do_something; $tw->Insert($result); $result = do_something_else; $tw->Insert($result);
should do what you want.
Tk::Text::Insert inserts the supplied text at the insertion point. I think it advances the insertion point, so repeated calls will append to what was inserted by the previous call.
This will accumulate text until Perl runs out of resources or you stop adding more text. There are methods to delete text from the widget.
Alternately, you could maintain the text you want to display in your own variable, then update the widget as needed:
$tw->Contents($textToDisplay);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: How to perform a subroutine run in cpan Tk::ExecuteCommand module
by Janish (Sexton) on Jun 26, 2014 at 02:06 UTC |