Thread Subs für Reiterwechsel (10 answers)
Opened by J-jayz-Z at 2005-07-18 22:57

J-jayz-Z
 2005-07-19 01:17
#44184 #44184
User since
2005-04-13
625 Artikel
BenutzerIn
[Homepage] [default_avatar]
Okay, hier ein kleines snippet:
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
#!/usr/bin/perl
use strict;
use warnings;

use Tk;
use Tk::NoteBook;

my $main = MainWindow->new();

my $note = $main->NoteBook()->pack();

my $page1 = $note->add('Notebook-1', -label => 'ReiterEins');
my $page2 = $note->add('Notebook-2', -label => 'ReiterZwei', -raisecmd => \&test
);

my $entry = $page1->Entry()->pack();
$entry->focus();

MainLoop();

sub test {
my $text = $entry->get();
$page2->Label(-textvariable => \$text)->pack() if($text);
$entry->delete('0.0','end');
}
perl -Mstrict -Mwarnings -e 'package blub; sub new { bless {} } sub bar {my $self=shift; $self->{bla}="5065726c2d436f6d6d756e697479"; return $self->{bla};} my $foo=blub->new();print "Hallo ";print pack("H*",$foo->bar()); print "\n"'

http://perl-tutor.de

View full thread Subs für Reiterwechsel