Here's some brief sample code that should give you an idea of how this is done:
# create the menu with stuff you want to show up in the menu on the 2nd level
my $pmenu = Win32::GUI::MakeMenu (
"Popup" => "Popup",
"> &Preferences" => "Prefs",
"> &Quit" => {
-name => "Quit",
-onClick => sub {
return -1;
}},
"> &Show Window" => {
-name => "Showwindow",
-onClick => sub{
$window->Enable();
$window->Show();
return 1;
}},
);
# then in the notifyicon, use the menu in the RightClick event:
my $notifyicon = $window->AddNotifyIcon (
-name => "ni",
-icon => $useicon,
-tip => "whatever your icon does",
-onRightClick => sub {
$window->TrackPopupMenu($pmenu->{Popup});
},
);
On 6/18/07, a98...@gm... <a98...@gm...> wrote:
> Hi,
>
> I want to make a short menu which appears after right-clicking on my notifyicon. is this possible? how can I make it?
> the right-click-event works fine.
>
>
> thx
> j.
>
> --
> GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
> Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
>
--
Geoffrey Spear
http://www.geoffreyspear.com/
|