7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = tkinit();
my $top = $mw->Toplevel();
$top->Button(-text => 'MW wiederherstellen',
-command => sub { $mw->deiconify; $mw->raise; } )->pack();
$mw->after(5000 => sub { $mw->withdraw } );
MainLoop;
1
2
3
4
5
6
7
8
9
10
11
12
13
sub systray_RightClick {
my $systray_menu = new Win32::GUI::Menu(
"SystrayMenu Functions" =>"SystrayMenu",
"> Öffnen" => "open_main",
);
my($x, $y) = Win32::GUI::GetCursorPos();
$config{Win32Window}->TrackPopupMenu($systray_menu->{SystrayMenu}, $x, $y-50);
}
sub open_main {
$config{MainWindow}->deiconify;
$config{MainWindow}->raise;
};
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
#!/usr/bin/perl
use Tk;
use Win32::GUI;
our %config = ();
my $main = MainWindow->new(
-height => 30,
-width => 50
);
$win32 = Win32::GUI::Window->new(
-name => 'Main',
-text => 'Perl TrayIcon',
-width => 0,
-height => 0,
-visible => 0
);
my $icon = new Win32::GUI::Icon('19.ico');
my $ni = $win32->AddNotifyIcon(
-name => "systray",
-id => 1,
-icon => $icon,
-tip => "Icon in der Systray"
);
sub systray_RightClick {
my $systray_menu = new Win32::GUI::Menu(
"SystrayMenu Functions" =>"SystrayMenu",
"> hier klicken" => 'test'
);
my($x, $y) = Win32::GUI::GetCursorPos();
$win32->TrackPopupMenu($systray_menu->{SystrayMenu}, $x, $y-50);
}
sub test {
print "hallo\n";
}
MainLoop;
7 Einträge, 1 Seite |