[plt-scheme] Class questions

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue May 13 19:25:22 EDT 2003

At Tue, 13 May 2003 18:17:41 -0500 (CDT), Ed Cavazos wrote:
> Separate question... Is it possible to override the draw-* methods
> (such as draw-line, draw-point, etc) ? If there was a class I could
> use as a base then it would be clearer to me, howerver I'm not sure
> how to create a derivative of a canvas device context. Let's say I had
> the extended-canvas% class as shown above and then wanted to override
> draw-line such that it wrote to the backing-store bitmap. It doesn't
> seem right to add a method to extended-canvas% called draw-line since
> the native draw-line operates on a device context.

I think you want to build your abstractions so they take a dc as
argument. Then, either use the canvas dc, or use a bitmap-dc with the
backing store in it.


Posted on the users mailing list.