[BUG][Q]Selection behavior in textmorphs

rrobbes rrobbes at info.unicaen.fr
Tue Mar 9 22:49:40 UTC 2004


Hi all, 

There's an annoying problem with the way selection works in textmorphs :
when the mouse leaves the textmorph (ie it looses focus),
the selection disappears, and therefore cannot be used.
This can be quite annoying, I recall that a while ago I posted
a simple fix to allow menus in textmorphs to be keyboard-driven,
but this fix was flawed when menu items who needed the selection
were triggered, as the textmorph selection was lost in the meantime. 

Today I looked further at the problem and noticed that PluggableTextMorph
had an instance variable named selectionInterval which is strangely used
(get/set code follow) 

selectionInterval
^ textMorph editor selectionInterval 

selectionInterval: i
 selectionInterval := i 

So when the morph loses focus, a call to selectionInterval returns
(1 to: 0), but the instance variable yields the correct answer
(ie (15 to: 18) for example). 

Is there a reason for this odd behavior ?
If not, I'll post tomorrow a [FIX] for this and to allow
real keybord control in PluggableTextMorphs. 

   Romain



More information about the Squeak-dev mailing list