[plt-scheme] Re: scrolling inside an editor-snip?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Oct 9 08:50:42 EDT 2007

At Tue, 09 Oct 2007 02:58:13 -0000, harsha wrote:
> >> override `draw' to send a suitable `refresh' call to
> >> the nested text% (to draw only the visible part, and with an offset
> >> that starts drawing at the right line)
> the refresh method, as it stands now just takes as an input an area of
> the editor, specified in local editor coordinates, there is no option
> for an offset. 

Ah, right --- I was confusing layers. Even the drawing context isn't
supplied at this layer...

> how is the absolute location of the drawing-area
> determined by the editor? 

The editor's administrator's `get-dc' method supplies both the drawing
context and the offset.

So, during the time that your editor-snip% class calls the `refresh'
method of the nested text%, the associated editor-admin% will need to
return the dc<%> and offset that was given to the editor-snip%'s `draw'
method --- except that the offset is further adjusted to implement
local scrolling.


Posted on the users mailing list.