Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Win32::OLE freezing Tk

by jcb (Priest)
on Dec 24, 2019 at 00:00 UTC ( #11110570=note: print w/replies, xml ) Need Help??

in reply to Win32::OLE freezing Tk

The problem is that you are performing a long-running task on the GUI thread and not returning control to the Tk MainLoop often enough. This is a fundamental mismatch, since Tk is event-based and long-running callbacks will hang the GUI. I usually encounter this with network interaction when combining Tk and LWP in the same program; my usual solution is to fork and handle LWP operations in child processes, passing results back over a pair of pipes (one monitored by Tk in non-blocking mode and one in blocking mode for passing large binary results up using Storable) but this probably will not work well on Windows.

I suggest looking into the threads support in perl; you may need a few shared variables for passing state between the threads. I have no idea how to get the Tk event loop to handle thread completion.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2020-06-04 06:05 GMT
Find Nodes?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?

    Results (30 votes). Check out past polls.