in reply to How do you toggle the system tray icon using Win32::Gui?
Don't know how supported it is but this is what I had to do is call Win32::GUI::NotifyIcon::Modify directly (it is located in the GUI.xs file for those with the source). Example works off the click on the tray icon.
Don't forget to get the -id bit the same across all calls.... Other problem I came across was the limit of 63 chars for the -tip windows doesn't like it and the good doctor will come and visit if you make it too long.
- snipped example -
Win32::GUI::NotifyIcon::Modify( $win, -id => 1, -icon => $icoDis, -tip => "Not Recording",
I would imagine this is the most "correct" way of changing the icon.
Also, you can't sleep() within a Win32::GUI program, that will freeze the UI for the user.
What you do is call Win32::GUI::Dialog(), then wait for some event to happen. There is a timer control. Return -1 from an event handler to exit the main event loop.
/J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you toggle the system tray icon using Win32::Gui?
by sblanton (Sexton) on May 06, 2009 at 19:48 UTC |