Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Win32::SysTray Issue

by PilotinControl (Pilgrim)
on Oct 18, 2020 at 11:55 UTC ( [id://11122978]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Win32::SysTray Issue
in thread Win32::SysTray Issue

that works however all it does is allow the main program to work and the icon menu does not...the program does not hang up anymore. Half solved.

Replies are listed 'Best First'.
Re^5: Win32::SysTray Issue
by jcb (Parson) on Oct 19, 2020 at 03:30 UTC

    That would be the first step; the rest involves setting up some kind of IPC between "parent" and "child" so that the icon menu can influence the main script's processing.

    An anonymous monk provided a better solution: simply call Win32::GUI::DoEvents­ periodically in your code. Note that this option means that the icon will be unresponsive until a DoEvents call is reached, so it does need to be called fairly often, such as on each iteration of any time-consuming loop.

    I use Tk on X11, so I am not particularly familiar with Windows GUI programming, but this seems to be similar to the type of problem I have solved in the past by forking workers and having them return results back to a main GUI process using pipes. In your case, the issue is a bit more complicated by the need for the GUI to be the side task. The *nix traditional solution would be to write an event-driven GUI wrapper for the command-line program but I do not know how well this strategy will work on Windows.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-25 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found