in reply to Win32::GUI window freezing, even with threading.

What do you think happens here if there is no data in the queue?

#wait for data, print data to GUI textbox while(Win32::GUI::DoEvents() != -1) { my $tmptxt = $DataQueue->dequeue(); $main_text_window->Append($tmptxt); }

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.

Replies are listed 'Best First'.
Re^2: Win32::GUI window freezing, even with threading.
by chute (Initiate) on May 28, 2013 at 13:20 UTC
    I took that from http://perl-win32-gui.sourceforge.net/cgi-bin/docs.cgi?doc=reference-methods#dialog

    I think that will execute my code block as long as the GUI isn't doing something.

    I could be wrong though.
      I took that from http://perl-win32-gui.sourceforge.net/cgi-bin/docs.cgi?doc=reference-methods#dialog

      There is no mention of "dequeue" anywhere on that page.

      The problem is not the bit you did take from that page; it is the bit you added:

      #wait for data, print data to GUI textbox while(Win32::GUI::DoEvents() != -1) { my $tmptxt = $DataQueue->dequeue(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $main_text_window->Append($tmptxt); }

      If the queue is empty, the call to dequeue() will block and your GUI will freeze.


      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.