Hi,
ich versuche gerade, mein Konsolenprogramm auf TK umzuwandeln - bin in diesem Thema aber neu. Ich möchte gern, dass das Ergebnis einer Berechnung im Textfeld $outputframe erscheint, das zuvor in der sub cap berechnet wurde. Leider bekomme ich immer die Fehlermeldung "bad text index", auch wenn ich statt $output mal "Hello" oder statt "insert" "end", "1.0" oder sonstwas angebe. Könnt ihr mir helfen? Bin schon am Verzweifeln ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl
use strict;
use Tk;
my $main = new MainWindow(-title => "Cooles Ding");
my $label = $main->Label(-text => "Cooles Ding")->pack();
my $outputframe = $main->Text(width => 80, height => 10)->pack();
my $exit_button = $main->Button(-text => "Beenden",
-command => sub {exit} )->pack(-fill => "x");
my $start_button = $main->Button(-text => "Berechnen",
-command => sub {my $output=cap(); $outputframe->insert($output,"insert");} )->pack(-fill => "x");
MainLoop;
sub cap { ... rechne rechne rechne ... }
Viele Grüße aus Calberlah
Der SilberStein
<a href="
http://www.skriptoase.de/">www.skriptoase.de</a>
# "It's all very perlish" (L.Wall)