[Oberon] N-O: HOW2 SelectTextStretch given beg, end ?

Chris Glur crglur at absamail.co.za
Sat Jan 13 05:03:06 MET 2007


Since linux-ETHZ-oberon allows multiple desktops, this makes
programming easier.  You can have a separate desktop for your
docu/tutors. Some docus want eg. a full size UserTrack to view.
Also separate desktop[s] for your notes/log-of-progress.
And of course a separate desktop for the source being compiled.
Although you can't cutNpaste between desktops [which are
separate linux-processes] communication via common 
file[s] is convenient.

These increased facilities prompted me to investigate making 
a tool which reduces the frustration of locating the 
'closing-bracket'/"END-token" of 'blocks which stretch over
multiple screens.  The ' "END" terminated blocks' begin with
one of: "BEGIN","WHILE", "FOR","IF", "LOOP".
I think that only leaves "REPEAT" ?

I morphed Chapter5.Text Example7 to make the tool which I'm
now using; which after setting the caret before the 'opening
bracket token' eg. "IF", moves the caret to the corresponding
"END".  [I'll put the 'project' to Edgar's wiki later.]

It would be nice if the 'block' could be selected, instead of 
just moving the caret to the "END". This would even allow
a single clux [N-O mouse chord] to colour the block !

One would: select the opening token & execute 'Do.SelctBlk',
and see the block selected  -- possibly over multiple screens.
And then have the ability to copy, colour ..etc. the block ?

I can't see how to select the TextStrech, given the beg, end.
There's plenty sample code and tutorials on GetSelection,
but SetSelection seems to be a taboo - not recommended.

My first/simplest approach failed:
1. exercise the given example[s] for GetSelection,
2. trace the SelectMesg fields: beg, end  to confirm,
3. modify these 2 fields eg. to beg+3, end+5, and the id field
  frrom Oberon.get to Oberon.set and hope that the other 
  unchaged fields are OK.
 
This fails with no symptoms.
I can't guess where the code would be to 'SetSelection'
as per mouse activation ?

Can someone advise/help ? Thanks,

== Chris Glur.



More information about the Oberon mailing list