in reply to Does this Tk program require a thread?
In "Mastering Perl/Tk", pg 402, they discuss a $mw->repeat function. From looking at it briefly, it loks like you want:
EBut this is suposed to be a non-blocking routine, as run will be called every 50 milliseconds, so you need to rewrite that part to see if there's new clipboard content and return if not. If it blocks, MainLoop stops running.$main->repeat(50 => \&run) MainLoop; sub run { $clip->WaitForChange(); # needs to NOT block. my $contents = $clip->Get(); if ($mode) { $clip->Set(uc($contents)); } }
ALthoough --Bob Niederman, http://bob-n.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Does this Tk program require a thread?
by nysus (Parson) on Jul 15, 2003 at 01:03 UTC | |
by bbfu (Curate) on Jul 15, 2003 at 01:28 UTC | |
by William G. Davis (Friar) on Jul 15, 2003 at 07:14 UTC |