[racket] Text% and editor-canvas% typewriter scrolling

From: Erich Rast (erich at snafu.de)
Date: Sun Oct 30 16:44:38 EDT 2011

Is it possible to (halfway easily) implement "typewriter" scrolling on
the basis of an editor-canvas% and text%. I've discovered
scroll-with-bottom-base which already goes in the right direction. Now
here is what I'm looking for:

- Editing always takes place on the same line, the edit line, whose
location is user-definable e.g. as the 20th line from the topmost
visible line or x pixels from the top or bottom of the editor canvas.

- Scrolling up: the cursor stays on the edit line and the text around it
scrolls down a line. (So part of the text might show up below the edit
line.)

- Scrolling down: the cursor stays on the edit line and the text around
it moves up a line (if there is more text below the edit line.)

- Editing: like scroll-with-bottom-base but on the user-defined edit
line (usually somewhere in the middle of third half of the canvas, but
must be definable somehow)

Is this possible? Any ideas how? Are there some internal classes I could
modify?


Best,

Erich



Posted on the users mailing list.