![]() |
![]() |
6 Einträge, 1 Seite |
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;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use warnings;
use strict;
use Tk;
use Tk::Photo;
my $mw = MainWindow->new;
my $popup_menu = $mw-> Menu (-type => 'menubar');
my $logo = $mw-> Photo (-file => "D:/pfad/icon.bmp");
$popup_menu-> command (-image => $logo, -command => sub {print "image";});
$popup_menu-> command (-label => "blabla", -command => sub {print "label";});
$popup_menu-> Popup (-popover => 'cursor', -overanchor => 's', -popanchor => 'nw');
MainLoop;
![]() |
![]() |
6 Einträge, 1 Seite |