perlboy_emeritus has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I'm trying to tie STDOUT to a Tkx Text widget and all attempts fail. The list of what I've tried would fill a page of dense text. Here is what works and also what does not, and the 'does not' is documented everywhere online exactly as I've expressed it, including in "Mastering Perl/Tk", pg 180. I'd perfer to use ROText in this case to simulate what one sees at the command line when running a non-Gui Perl program.

What works, perfectly, and renders correctly, simplified:

use warnings; use strict; use v5.38; use Tkx qw(MainLoop combobox grid); use Tkx::ROText; ... my $text = Tkx::tk__text(".text",); my $text1 = $mw->new_tkx_ROText();

What does not work, obviously not both together, but either/or:

tie *STDOUT, ref $text, $text; tie *STDOUT, 'Tkx::ROText', $text1; Can't locate object method "TIEHANDLE" via package "main" at GCGuiQuer +y.pl line 31.

Any suggestions? I use Tkx, not Tk, because Tk fails to recognize font properties -underline and -overstrike whereas using named fonts in comparable Tkx constructions works correctly.

Thanks for your help.

Replies are listed 'Best First'.