Thread Tk-Callbacks: Parameter verschwinden (5 answers)
Opened by FIFO at 2006-03-05 20:05

FIFO
 2006-03-05 21:21
#45284 #45284
User since
2005-06-01
469 Artikel
BenutzerIn

user image
Hier mal eine Minimalversion als Komplettskript:

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
# callbacktest.pl

use strict;
use warnings;
use Tk;

my $label;

sub c_test {
$label->configure(-text => $_[1]);
}

my $mw = MainWindow->new();

my $button = $mw->Button(
-text => 'Ctrl-S',
-command => [\&c_test,'Hallo'],
);

$label = $mw->Label(-background => '#FFFFFF');

$mw->bind('<Control-s>' => [\&c_test,'Hallo']);

$label->pack();
$button->pack();

MainLoop;
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Tk-Callbacks: Parameter verschwinden