[racket] Plot: plot-new-window never happens?
On 04/18/2012 06:27 AM, Deren Dohoda wrote:
> It was convenient to have something that bypassed the whole gui issue.
> Since it really is a gui issue, I am not too offended that my own
> laziness got in my way.
I just pushed a fix that turns your so-called laziness into correct
behavior. :) The original loop will work as you intended it.
Neil ⊥
> >> > At Tue, 17 Apr 2012 10:40:55 -0400, Deren Dohoda wrote:
> >> >> I was messing around with a spline utility last night and was
> using
> >> >> the plot-new-window? setting to get a plot. The goal was to
> share an
> >> >> exe with a coworker who doesn't have Racket. Just a
> command-line app
> >> >> but to get the plot to display I needed a window and this seemed
> >> >> awesome. The problem is I couldn't get the plot to display
> when the
> >> >> thread was in a procedure. The window would appear but it was
> like the
> >> >> plot backend wasn't free to draw to it. Here's a way to
> reproduce it
> >> >> on v5.2:
> >> >>
> >> >> #lang at-exp racket
> >> >> (require plot)
> >> >> (plot-new-window? #t)
> >> >> (let loop ()
> >> >> (let ((dummy (read)))
> >> >> (if (and (number? dummy) (zero? dummy))
> >> >> (void)
> >> >> (begin
> >> >> (plot (function (λ(x) (* x x)) -2 2))
> >> >> (loop)))))
> >> >>
> >> >> So long as you are looping, new windows will appear without plot
> >> >> contents. When you finally quit (here by entering the number
> zero) all
> >> >> the plots are drawn in those windows. Any help? Did I do
> something
> >> >> horribly dumb?
> >> >>
> >> >> Thanks,
> >> >> Deren