Hey Monks, Well, I dont get why the SystrayExit_Click function aint called here:
#!/usr/bin/perl use warnings; use strict; use Win32::GUI; my $mw_win32; &do_win32_stuff; sub do_win32_stuff{ $mw_win32 = new Win32::GUI::Window( -width => 0, -height => 0, -name => 'MainWindow'); my $icon = new Win32::GUI::Icon('icon.ico'); new Win32::GUI::NotifyIcon($mw_win32, -name => "SysTray", -id => 1, -icon => $icon, -tip => "I\'am in the Systray!"); my $call = Win32::GUI::Dialog(); $mw_win32->Notify->Delete(-id => 1); } sub SysTray_RightClick { my $systray_menu = new Win32::GUI::Menu( "SystrayMenu Functions" => "SystrayMenu", "> Info" => "SystrayInfo", "> Exit" => "SystrayExit" ); my($x, $y) = Win32::GUI::GetCursorPos(); $mw_win32->TrackPopupMenu($systray_menu->{SystrayMenu}, $x, $y); 1; } sub SystrayExit_Click { print "WORK FOR GOD SAKE!!\n"; exit; } sub Main_Terminate { Win32::GUI::NotifyIcon::Delete( $mw_win32, -id => 1 ); return -1; } sub SysTray_Terminate { Win32::GUI::NotifyIcon::Delete( $mw_win32, -id => 1 ); return -1; } sub Main_Minimize { $mw_win32->Disable(); $mw_win32->Hide(); 1; }
What am I missing? Im using Win32::GUI v1.0 btw.
(Win32-GUI-1.0-PPM-5.8.zip)

Thanks,
Ace

In reply to Functions aint called using Win32::GUI::NotifyIcon by Ace128

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.