[Oberon] ETHO Display structure.
Bob Walkden
bob at web-options.com
Sat Mar 9 21:33:56 CET 2013
> From: eas lab [mailto:lab.eas at gmail.com]
>
> }You will learn how the modules Texts, TextFrames and other important
> modules } interact and what a "handler" is and so on.
>
> AFAIK that's amply covered in Chapter*.Text, which I started reading
> over
> 15 years ago. And the fact that I was able to 'recognise' how the
> different sized bricks are laid down, according to their 'lib-spec'
> indicates that the knowledge that percolated up from my subconscious,
> was previously already read.
>
> Although I must admit that I only vaguely remember how a handler works.
>
> Meanwhile let's take Paul Reed's input as an example of collaborative
> contribution:
> confirmed my stated assumptions,
> corrected my wrong assumptions,
> pointed to the module containing the relevant info; which has finally
> allowed me to:
>
> Repeat
> get(ch);
> writeCharAtCursor;
> Until ch = "q"
>
> It's just that the resolution for fast navigating individual chars is
> impractical. Words are more practical.
> I was much influence by EditKeys, but forgot that the cursor 'snaps'
> to the last-char-of-the-line, and positioning it quickly inside the
> line is not so easy.
>
I haven't been following this closely, so forgive me if I've misunderstood
what you're doing, but if it's really as simple as that bit of code
suggests, then this is a very easy way to do it:
MODULE Bob;
IMPORT Oberon, Input;
PROCEDURE Glur * ;
VAR
ch: CHAR;
m: Oberon.InputMsg;
BEGIN
m.id := Oberon.consume;
m.fnt := Oberon.CurFnt;
m.col := Oberon.CurCol;
m.voff := Oberon.CurOff;
REPEAT
Input.Read( ch );
m.ch := CAP(ch); (* CAP proves that it's not the Oberon loop
that's writing the text *)
Oberon.FocusViewer.handle( Oberon.FocusViewer, m );
UNTIL ch = 'q';
END Glur;
BEGIN
END Bob.
Bob.Glur
More information about the Oberon
mailing list