Thread tk::balloon und menu type menubar + cascade: der balloon wird nicht angezeigt (14 answers)
Opened by PerlProfi at 2007-01-06 11:52

PerlProfi
 2007-01-08 18:52
#46067 #46067
User since
2006-11-29
340 Artikel
BenutzerIn
[default_avatar]
Hatte gerade ein kleines Beispiel fertig, getestet, und es klappt wieder nicht :(
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/perl
use strict;
use warnings 'all';
use Tk;
use Tk::Balloon;

# MainWindow erstellen
my $mw = tkinit(-title => "Tk::Balloon");

# menuframe und statusframe erstellen
my $mf = $mw -> Frame ( -relief => "flat" ,
-bd => 1 )
-> pack ( -fill => "x" ,
-expand => 1 );
my $sf = $mw -> Frame ( -relief => "groove" ,
-bd => 1 )
-> pack ( -fill => "x" ,
-expand => 1 );

# Menü erstellen
my $menubar = $mf -> Menu ( -type => "menubar" ,
-menuitems =>
[
[
"cascade" => "Datei" ,
-tearoff => 0 ,
-menuitems =>
[
[
"command" => "Neu" ,
-command => sub { print"neu\n" }
] ,
"-" ,
[
"command" => "Beenden" ,
-command => sub { $mw->destroy }
]
]
]
] );
$mw -> configure ( -menu => $menubar );

# Statuslabel erstellen
my $sl = $sf -> Label ( -text => "Starttext" ,
-font => "{Arial} 10 {normal}" )
-> pack ( -side => "left" ,
-padx => 2 ,
-pady => 2 );

# Balloon erstellen
my $b = $mw -> Balloon ( -statusbar => $sl ,
-initwait => 1 ,
-state => "status" );

$b -> attach ( $sf ,
-msg => "Statusbar" );

# attach() menu entrys
$b -> attach ( $menubar ,
-state => "status" ,
-msg =>
[
"Menü: Datei" ,
"Eine neue Datei erstellen" ,
"Programm beenden"
] );

MainLoop;

Was hab ich denn da jetzt falsch gemacht?
Vorhin hats noch funktioniert...

MfG PerlProfi

View full thread tk::balloon und menu type menubar + cascade: der balloon wird nicht angezeigt