PilotinControl has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks!
I have another issue that I am trying to wrap my head around the code is below:
use strict; use Win32::SysTray; my $tray = new Win32::SysTray ( 'icon' => 'C:\images\logo.ico', 'single' => 1, ) or exit 0; $tray->setMenu ( "> &Test" => sub { print "Hello from the Tray\n"; }, ">-" => 0, "> E&xit" => sub { return -1 }, ); $tray->runApplication;
The above code works as it should in standalone mode. However when I add it to a larger Win32::Console program only THIS code works:
my $tray = new Win32::SysTray ( 'icon' => 'C:\images\logo.ico', 'single' => 1, ) or exit 0;
The second part of the code never gets executed. If the second part of the code is added the program freezes. Any ideas? I believe it has to do with the $tray->runApplication; part conflicting with the Win32::Console. Thanks in advace!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win32::SysTray Issue
by syphilis (Archbishop) on Oct 17, 2020 at 04:09 UTC | |
by swl (Parson) on Oct 17, 2020 at 04:22 UTC | |
Re: Win32::SysTray Issue
by Corion (Patriarch) on Oct 17, 2020 at 06:01 UTC | |
by PilotinControl (Pilgrim) on Oct 18, 2020 at 01:22 UTC | |
by jcb (Parson) on Oct 18, 2020 at 02:51 UTC | |
by PilotinControl (Pilgrim) on Oct 18, 2020 at 11:55 UTC | |
by jcb (Parson) on Oct 19, 2020 at 03:30 UTC | |
Re: Win32::SysTray Issue ( Win32::GUI::DoEvents )
by Anonymous Monk on Oct 18, 2020 at 07:31 UTC | |
by PilotinControl (Pilgrim) on Oct 19, 2020 at 20:11 UTC | |
by jcb (Parson) on Oct 19, 2020 at 23:46 UTC | |
by PilotinControl (Pilgrim) on Oct 21, 2020 at 01:14 UTC | |
by jcb (Parson) on Oct 21, 2020 at 01:23 UTC | |
| |
by PilotinControl (Pilgrim) on Oct 20, 2020 at 02:56 UTC | |
by jcb (Parson) on Oct 21, 2020 at 01:16 UTC | |
| |
by Anonymous Monk on Oct 20, 2020 at 00:13 UTC | |
Re: Win32::SysTray Issue
by pryrt (Abbot) on Oct 21, 2020 at 20:54 UTC | |
by pryrt (Abbot) on Oct 22, 2020 at 17:05 UTC |
Back to
Seekers of Perl Wisdom