Leser: 1
6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
...
my $edit_window = $main_window->Toplevel();
my $edit_action = $edit_window->Frame()->pack();
my $edit_SaveCopyButton = $edit_action->Button(
-text => 'Kopie Speichern',
-command => [\&SaveRecord,'copy'],
);
$edit_window->bind('<Control-s>' => [\&SaveRecord, 'copy']);
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;
Quote\n\n... in fact, Tk implicitly passes the bound widget reference as the first argument to the callback , adding any of our explicit arguments afterwards. (Mastering Perl/Tk, S. 364)
6 Einträge, 1 Seite |