Fellow Monks,

I'm facing a bit of a mindblock, and not sure about which decision to go for.

I'm writing some app for Windows and there's a lot of Events that need blocking event monitors;

The first event is via Win32::Clipboard which waits for the clipboard to change and needs to capture the data and do something with it.

I'm coding a GUI for the app with wxPerl and not sure how to handle the clipboard thing since I get stuck within MainLoop.

So I decided to split it into two piece, one script handles capturing the clipboard data, and another for the GUI, so came the passing of data; fork+pipes are blocking. I tried to store the data in a temp file, but there was a need to notify the GUI that the temp file has changed, Win32::ChangeNotify can do that, but it's blocking.

I'm just starting with Wx, and probably missing much, is there a way to implement Win32::Clipboard from with a Wx app?

My idea was to try something like:

while (1) { # 100 as to try and make room for other things to happen # as if it is non-blocking if ($CLIP->WaitForChange(100) == 1) { $clipboard = $CLIP->Get(); } }

somewhere, but even that found no place to go...

Any pointers are appreciated.


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

In reply to Win32::Clipboard from within a wxPerl by Chady

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.