Hallo noch mal,
das mit dem insert habe ich jetzt hinbekommen!
jetzt möchte ich aber geren noch mit get arbeiten.
habe schon die ganzen code teile heraus gefunden
und dabei mein fehler gefunden den ich aber nicht beheben
kann :-(
http://www.karo-edv.de/gui.jpg
es geht um das große fenster was meine shell darstellen soll!
hier kann ich per insert (danke noch mal) daten einfügen.
aber ich möchte daten die ich selbst dort schreibe mit get
wieder auslesen. geht aber nett :-(
es liegt daran das ich das fenster als mw->scrolled angelegt
habe und nicht als entry.
als scrolled erfüllt es meine anforderungen bis auf das get
und was dabei wichtig ist das ich ja den scroll balken benötige.
wie kann man das anders lösen? habe schon im super wiki geschaut und bei google aber nicht das passende gefunden.
hier mal mein code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use strict;
use warnings;
use Tk;
#use Tk::Text;
use Win32::GUI;
use Term::ReadLine;
#****************************
# Find Current Time
#****************************
my @time = localtime();
my $time_string = sprintf "%02d.%02d.%04d %02d:%02d.%02d",
$time[3], $time[4]+1, $time[5]+1900,
$time[2], $time[1], $time[0];
#****************************
# New Main Window
#****************************
my $mw = MainWindow->new;
$mw->geometry("670x400+41+66");
my $Message = "Pls. Enter Session Name (W12345)";
$mw->title("Host Terminal Emulator V.0.1, $time_string");
my $screen1 = $mw->Label(-text => "$Message",
-background => '#D4D0C8',
-font => '{Arial} 11 {bold}')->pack;
$screen1->place (-width => 250,
-height => 40,
-x => 0,
-y => 0);
#****************************
# Session Input Filed
#****************************
my $Session = $mw->Entry(-text => my $PID,
-width => 80,
-font => '{Arial} 10 {bold}')
->pack (-expand => 1,
-fill => 'x',);
$Session->place(-width => 70,
-height => 30,
-x => 250,
-y => 5);
$Session->focus();
#****************************
# Command Window
#****************************
my $scroll = $mw->Scrolled("Text",
-font => '{Arial} 10 {bold}',
-scrollbars => 'e')
->pack;
$scroll->place(-width => 575,
-height => 350,
-x => 5,
-y => 45);
#$scroll->bind('<Return>' => [$scroll, 'validate', Ev(['get'])]);
$mw->bind ('<Return>', \&call2);
#****************************
# Open Session to TIPFEO
#****************************
my $TIPFEO = $mw->Button(-text => "TIPFEO",
-font => '{Arial} 10 {bold}',
-height => 1,
-width => 8,
-underline => 4,
-anchor => 'c',
-command => \&call_term)
->pack (-ipadx => '45');
$TIPFEO->place (-x => 430,
-y => 5,);
MainLoop();
sub call_term{
my $str1 = "hallo du da";
$scroll->insert('end', "$str1");
my $str = $str1;
&call2($str);
}
sub call2{
my $str1 = $scroll->get();
print $str1;
}
der teil der hier das probelm ist, ist der das command window
sorry fuer die einreihung das klappt nicht so ganz vom
slickedit hier rein.
merci schon mal
rambo
Edit renee: ptks Wunsch nachgekommen ;)\n\n
<!--EDIT|renee|1077657228-->