Thread checked (5 answers)
Opened by Froschpopo at 2005-05-05 15:48

pktm
 2005-05-07 00:47
#43935 #43935
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
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
#!/Perl/bin/perl

use strict;
use Tk;
use Tk::Menu;

my $mw = Tk::MainWindow->new();

my $var = 1;
my $menuitems = [
[Cascade => "~Datei", -menuitems =>
[
[Button => "~Neu", -command => sub{ return 1; }],
[Separator => ""],
[Button => "~Öffnen", -command => sub{ return 1; }],
[Button => "~Sichern", -command => sub{ return 1; }],
[Checkbutton => "~checkbox", -command => sub{ return 1; }, -variable => \$var,],
],
],
];
my $menu = $mw->Menu(-menuitems => $menuitems);
$mw->configure(-menu => $menu);

$mw->Button(
-text=>'Knopf',
-command => sub{
if( $var == 1 ) {
$var = 0;
}else{
$var = 1;
}
},
)->pack();
$mw->Label(-textvariable => \$var)->pack();

MainLoop;


Bringt dich das weiter?
http://www.intergastro-service.de (mein erstes CMS :) )

View full thread checked