[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] CDP: Orbit Scribbler



On 20000525.2130, kpreid@attglobal.net (Kevin Reid) wrote:

< a neat little screen-saver-type-thing >

Kevin, about your code...

>sub ltwh ($$$$) {
>  my ($left, $top, $width, $height) = @_;
>  new Rect ($left, $top, $left+$width, $top+$height);
>}

May I ask what ($$$$) is there for?


>for (1..20) {WaitNextEvent;}

And this?  Doesn't seem to be inside a loop.  An initial pause, perhaps?


>$system_time = 40;
...
>$tick = 0;
>while ($win->window) {
>  ++$tick;
...
>  unless ($tick % $system_time) {
>    WaitNextEvent(0);
>  }
>}

This looks like it is your way of not having the script hog the CPU.  
Pause every 40th iteration to collect and process events.  The POD for 
Events.pm lists a SLEEP parameter for WaitNextEvent - is that what the 0 
is for?  Regardless of what value I plug in there it seems to make no 
difference.  I'm also curious about why you left out (0) in the first 
instance, yet included it in the second.

Henry.

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org