[racket] Interactive Canvas

From: Nick Shelley (nickmshelley at gmail.com)
Date: Mon Apr 9 16:20:46 EDT 2012

I don't have much gui programming experience, so sorry if this is a dumb
question.

I want to draw a bunch of rectangles and sub-rectangles on a canvas and
have something happen when each sub-rectangle is moused over. I was
thinking about just making each sub-rectangle its own canvas so it can
handle the 'enter mouse event, but some of the rectangles need to be
rotated so I don't think that would work.

Ideally I want to define each rectangle as it's own entity with
sub-rectangles inside of it that can handle mouse events. Then I want to be
able to translate and rotate that entity (or place it on the canvas) and
have the mouse-handling regions automatically move with it. However, I
don't know of anything that can both be drawn with a transformation matrix
and handle mouse events at the same time, so I'm wondering what things I
need to put together and how I should combine them to get the desired
behavior.

Any suggestions would be appreciated. Thanks.

-Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120409/eac3bfba/attachment.html>

Posted on the users mailing list.