Thread popupmenü mit images?, Perl Tk (5 answers)
Opened by #Kein Kommentar at 2007-11-15 19:00

Spieler
 2007-11-15 21:04
#102460 #102460
User since
2007-09-24
70 Artikel
BenutzerIn
[default_avatar]
Hallo,

eigentlich müsste es unabhängig von der Art des Menus sein. Es funktioniert auch:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 use warnings;
use strict;

use Tk;

my $mw = MainWindow->new;
my $m = $mw->Menu(-popover => 'cursor',
-tearoff => 0,
);


my $image = $mw->Photo(-file => Tk->findINC(
'Xcamel.gif'));
$m->command(-bitmap => 'info' ,
-command => sub{print "bitmap\n"});
$m->command(-image => $image,
-command => sub{print "image\n"});

my $text = $mw->Button(-text => 'menu',
-command => [$m,'Popup'],
)->pack;
MainLoop;


Grüße, Christoph

View full thread popupmenü mit images?, Perl Tk