Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Win32::SysTray Issue

by jcb (Parson)
on Oct 19, 2020 at 03:30 UTC ( [id://11122994]=note: print w/replies, xml ) Need Help??


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

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://11122994]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-03-28 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found