Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: perl tk mainwindow hangs

by mtmcc (Hermit)
on Sep 23, 2013 at 14:46 UTC ( [id://1055301]=note: print w/replies, xml ) Need Help??


in reply to perl tk mainwindow hangs

perl Tk runs in a single thread, so if you process a lot of information in a subroutine, the GUI will seem frozen until the subroutine passes back to Mainloop.

One way around this is with threads. Although Tk itself isn't thread-safe, there are ways to do it. Have a look at this, for example: Perl/Tk threading and/or cron job?

I hope that helps!

Replies are listed 'Best First'.
Re^2: perl tk mainwindow hangs
by simonz (Sexton) on Sep 23, 2013 at 16:09 UTC

    Hi ,
    Thanks for the reply
    Actually due to some limitations, I can not use threads.
    Was reading about MainWindow doOneEvent(), but not sure how can that be implemented. Can anybody please give any idea ?

      I can not use threads.

      Why not?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1055301]
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: (6)
As of 2024-04-23 13:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found