Thread Konsolenausgabe im "Fenster" erscheinen lassen? (5 answers)
Opened by Brenner at 2009-05-25 09:48

#Kein Kommentar
 2009-05-25 15:24
#121890 #121890
User since
2007-06-09
575 Artikel
HausmeisterIn
[default_avatar]
vielleicht willst du auch die ausgabe umleiten?

ein beispiel aus Tk::Text:
Quote
TIED INTERFACE

The Perl/Tk Text widget also has built-in TIEHANDLE methods for print and printf statements. This means you can print to file handles tied to a Text widget, and the tied methods automatically insert the print statement's arguments into the Text widget.

For example:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 #!/usr/local/bin/perl -w
use POSIX 'acos';
use Tk;
use strict;

my $mw = MainWindow->new;
my $text = $mw->Text(qw/-width 40 -height 10/)->pack;

tie *STDOUT, ref $text, $text;

print "Hello Text World!\n";
printf "pi ~= %1.5f", acos(-1.0);

MainLoop;

Gerade weil wir alle in einem Boot sitzen, sollten wir froh sein, dass nicht alle auf unserer Seite sind

View full thread Konsolenausgabe im "Fenster" erscheinen lassen?