<div dir="ltr"><div>That way has the property that each plot window has its own thread of execution, which is probably not necessary (I don't know if plot windows communicate or if that matters), but if it were me, I'd probably just make one extra thread, not N, and I'd put the reading into the extra thread not the GUI, like the below. <br>
</div><div><br></div><div><div>#lang racket/gui</div><div>(require plot)</div><div>(plot-new-window? #t)</div><div>(define (do-one)</div><div> (define dummy (read))</div><div> (cond</div><div> [(and (number? dummy) (zero? dummy))</div>
<div> #f]</div><div> [else</div><div> (queue-callback</div><div> (λ () </div><div> (plot (function (λ (x) (* x x)) -2 2))))</div><div> #t]))</div><div><br></div><div>(when (do-one)</div><div> (void</div>
<div> (thread</div><div> (λ ()</div><div> (let loop ()</div><div> (when (do-one)</div><div> (loop)))))))</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sun, Mar 17, 2013 at 4:42 AM, Laurent <span dir="ltr"><<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div>So, does this means that Deren's program from<br><a href="http://lists.racket-lang.org/users/archive/2012-April/051490.html" target="_blank">http://lists.racket-lang.org/users/archive/2012-April/051490.html</a><br>
would then look like that:<br><br>#lang racket<br>(require plot)<br>(plot-new-window? #t)<br>(let loop ()<br> (let ((dummy (read)))<br> (if (and (number? dummy) (zero? dummy))<br> (void)<br> (begin<br> (parameterize ([current-eventspace (make-eventspace)])<br>
(plot (function (λ(x) (* x x)) -2 2)))<br> (loop)))))<br><br></div>?<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">Laurent<br></font></span></div>
<div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Sun, Mar 17, 2013 at 7:15 AM, Eli Barzilay <span dir="ltr"><<a href="mailto:eli@barzilay.org" target="_blank">eli@barzilay.org</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>On Thursday, Robby Findler wrote:<br>
> Also: I don't think that you need a parameter for this default. the<br>
> current-eventspace parameter would already do this job.<br>
<br>
</div>IOW, Robby wants no keyword or parameter, just the default behavior,<br>
and if there's a problem with that then people would deal with it like<br>
with any other gui code. FWIW, I'm on that side too.<br>
<div><br>
--<br>
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br>
<a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a> Maze is Life!<br>
</div></div></div><div class="im"><div><div>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></div></blockquote></div><br></div>
</blockquote></div><br></div>