Code Comments
Programming Forum and web based access to our favorite programming groups.I know I know ... it's in the top 10 FAQs: how to output in a nonblocking way. My problem is just slightly different: I want to output the result of an internal calculation (say an iteration that produces a couple of values ($x,$y) each time) as a plot of the pixel onscreen: $dot=$cv->createOval($x,$y,$x+1,$y+1); from the related FAQs I saw I had to do something on the line of: open(H, "tail -f -n 25 $ARGV[0]|") or die "Nope: $!"; $mw->fileevent(\*H, 'readable', [\&fill_text_widget, $t]); .. but I dont know how to build my pipe: I'm not getting input from an external program, but from an internal sub any help appreciated... Alessandro Magni
Post Follow-up to this messageAlythh wrote: > I know I know ... it's in the top 10 FAQs: how to output in a > nonblocking way. > > My problem is just slightly different: I want to output the result of > an internal calculation (say an iteration that produces a couple of > values ($x,$y) each time) as a plot of the pixel onscreen: > $dot=$cv->createOval($x,$y,$x+1,$y+1); > > from the related FAQs I saw I had to do something on the line of: > open(H, "tail -f -n 25 $ARGV[0]|") or die "Nope: $!"; > $mw->fileevent(\*H, 'readable', [\&fill_text_widget, $t]); > ... You don't seem to need fileevent. What you simply need is: $cv->update; after each call to createOval. --Ala
Post Follow-up to this messageGod bless you... that's was exactly what I needed. Unfortunately I still have not very clear this notion of blocking events - but in this case an "update" was just needed. Thanks! Alessandro
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.