[racket-dev] [plt] Push #25220: master branch updated

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Aug 16 20:36:20 EDT 2012

On Thu, Aug 16, 2012 at 7:31 PM, Neil Toronto <neil.toronto at gmail.com> wrote:
> Is there a way to invalidate just one part of a GUI element? I'd have liked
> having that recently on a little game I made. All I could find was
> `refresh', which doesn't take parameters. I didn't like having to redraw the
> entire board whenever a single piece was moved.

You have to set up your own protocol at the canvas% level (just save
some state variables indicating which parts really need to be redrawn
on the next redraw should work (and maintain a bitmap for the rest)).

There is one in place for text% objects already, but I don't see a way
to make it work for the blue boxes because the protocol kind of
assumes that no drawing is happening in the margin. But the blue boxes
draw there. So the blue boxes are kind of cheating (but I think it
looks better).


Posted on the dev mailing list.