Editing an UpdatingStringMorph
Stephane Ducasse
ducasse at iam.unibe.ch
Wed May 23 14:33:42 UTC 2001
on 5/19/01 6:52 AM, Dan Ingalls at Dan.Ingalls at disney.com wrote:
>> On the other hand, the TextMorphs are not working in the TableMorph. After
>> I type one character the focus shifts to the start of the textMorph. So,
>> for example, if you just type, everything appears backwards.
>
> A number of problems have crept into TextMorph over the years since it was
> first written. Rather than fix them all right now, I'll at least explain this
> one enough so that some other brave soul should be able to fix it.
>
> The state required to type text into a TextMorph is kept in a TextMorphEditor.
> It inherits all the keyboard commands form the old MVC ParagraphEditor, and
> keeps track of the selection. It is thrown away when the text is not being
> edited. [Even the Paragraph (captures composition into lines) is thrown away
> when the text is not being displayed, but that's another story]. The editor
> gets thrown away by #releaseEditor, when focus leaves, and it gets re-created
> on demand in #installEditor. Doing a release/install cycle is almost
> transparent, except that you lose the selection. If this happens during
> type-in, you guessed it, the typing gets reversed.
>
> There are two solutions when this happens. Either it's a situation where you
> have control of both the release and the install, or not. If it is, then you
> can save the prior editor, and then use "installEditorToReplace: priorEditor"
> for the install. If it's not, then either you have to prevent the release
> (say, avoid losing control, or focus), or you have to save the selection state
> and restore it as is done in installEditorToReplace:.
Dan
When I implemented the possibility to have multiple distinct shortcut tables
and not only one for all the system, I noticed that the paragraphEditor
table or holder I do not remember now was recreated after each line of a
text. In the first change I made I had problem to understand why I was
losing the instance.
Is it the same thing that you described (or a consequence)?
I found frustrating to have to recopy all the time this information.
> - Dan
>
>
More information about the Squeak-dev
mailing list
|