Thread TK- Textausgabe in Listbox: Frame mit Listbox - Textausgabe (9 answers)
Opened by nickjag at 2005-04-11 13:46

renee
 2005-04-11 16:27
#43430 #43430
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Was soll nummeriert werden?? die Zeilen oder was??

probier mal:
Code: (dl )
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
#!/user/bin/perl -w

use strict;

use Tk;

my $counter = 0;
my $haupt = new MainWindow;

my $links= $haupt->Frame();
$links->Label(-text => "Geben Sie einen Namen fuer die Datei an:")->pack();
my $ein = $links->Entry();
$ein->pack();

my $schalter = $links->Button(-text => "Eintragen",
-command => \&eintragen
)->pack();

my $schalter2 = $links->Button(-text => "Beenden",
-command=>[$haupt => 'destroy']
)->pack(-pady => "10");

my $rechts= $haupt ->Frame();
$rechts->Label(-text =>"Text Ausgabe:")->pack();
my $daten = $rechts ->Listbox();
$daten->pack();

$links ->pack(-side =>"left");
$rechts ->pack(-side =>"right");

MainLoop();

sub eintragen {
$daten->insert('end', $counter."". $ein->get());
$counter++;
}
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread TK- Textausgabe in Listbox: Frame mit Listbox - Textausgabe