It looks like it's not a question of running DrRacket for a while, but
of having multiple tabs in DrRacket. And, more specifically, it's not
about DrRacket, but about showing a window containing a `tab-panel%`
instance that uses the 'no-border style on OS X.
For example, start DrRacket with your program in one window. Create a
new window (not a new tab) and paste in
#lang racket/gui
(define f (new frame%
[label "Slower"]
[width 200]))
(new tab-panel%
[choices '("A" "B")]
[parent f]
[style '(no-border)])
(send f show #t)
but don't run it. Start your universe program, and it should be ok.
Start running the tab-panel program, and your universe program will
misbehave. Close the frame created by the tab-panel program, and your
universe program will behave correctly again.
Using the 'no-border style for `tab-panel%` triggers the use of a
third-party widget PSMTabBarControl, so I think the problem must be in
that widget's implementation or its interaction with the `racket/gui`
event loop. In any case, now that I know that PSBTamBarControl is
relevant, I should be able to fix it soon.
At Wed, 06 Apr 2016 18:10:05 -0400, "John Clements" wrote:
>
> > On Apr 6, 2016, at 9:02 AM, Matthew Flatt <[email protected]> wrote:
> >
> > If the problem happens after DrRacket has been running for a while,
> > then that's good information and definitely a problem to investigate.
>
> I can confirm that (after 3-5 hours of development work) the problem is back.
>
> I also shortened the program down to about 36 lines (below). Finally, once
> again I restarted DrR and the problem went away.
>
> I’ll go ahead and file a bug report, I guess.
>
> Okay, done.
>
> John
>
>
> #lang racket
>
> (require 2htdp/universe
> 2htdp/image)
>
> (define r (rectangle 40 40 'solid 'green))
>
> ;; represents a position on the screen
> (struct posn (x y) #:transparent)
>
> ;; in seconds:
> (define TRANSITION-TIME 1)
>
> ;; in frames per second
> (define FRAME-RATE 40)
>
> (define SCENEWIDTH 400)
> (define SCENEHEIGHT 300)
>
> (define transition-frames (* TRANSITION-TIME FRAME-RATE))
>
> ;; given frame number, overlay
> ;; image at the correct location
> (define (draw-world w)
> (define frac (/ (modulo w transition-frames) transition-frames))
> (define 1-frac (- 1 frac))
> (place-image r (+ (* 1-frac 50) (* frac 100))
> (+ (* 1-frac 120) (* frac 115))
> bg-scene))
>
> (define bg-scene (empty-scene SCENEWIDTH SCENEHEIGHT))
>
> (big-bang 0
> [to-draw draw-world]
> [on-tick add1 (/ 1 FRAME-RATE)])
>
>
>
> >
> > Thanks!
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.