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.