Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Win32::SysTray Issue

by syphilis (Archbishop)
on Oct 17, 2020 at 04:09 UTC ( [id://11122936]=note: print w/replies, xml ) Need Help??


in reply to Win32::SysTray Issue

Hi,

I can't reproduce the problem. I've taken your script, inserted use Win32::Console, specified a .ico file that exists on my system, and inserted print "Continuing on ...\n" to verify that the script does continue on to process the setMenu() command:

UPDATE: Oh ... I had missed the $tray->runApplication; at the end, but I still don't see any crash.
use strict; use Win32::Console; use Win32::SysTray; my $tray = new Win32::SysTray ( 'icon' => 'C:\_32\pscrpt\guiperl.ico', 'single' => 1, ) or exit 0; print "Continuing on ...\n"; $tray->setMenu ( "> &Test" => sub { print "Hello from the Tray\n"; }, ">-" => 0, "> E&xit" => sub { return -1 }, ); $tray->runApplication;
It simply prints out Continuing on ... and exits cleanly.
For me, it now outputs Continuing on ... and then hangs - irrespective of whether Win32::Console is loaded or not.
What else do I need to do in order to see the problem that you've described ?

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: Win32::SysTray Issue
by swl (Parson) on Oct 17, 2020 at 04:22 UTC

    Same here. The only code changes I made were to avoid indirect object creation, and to check the error on its own line. However, I would not imagine those would have any effect on the larger program.

    # ... my $tray = Win32::SysTray->new ( 'icon' => 'C:\images\somelogo.ico', 'single' => 1, ); exit 0 if !$tray; # ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122936]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found