[squeak-dev] How to reserve a small spacing for displaying the text cursor ?

Chris Muller asqueaker at gmail.com
Thu Oct 3 01:30:49 UTC 2013


Hey Nicolas and Tim, while doing your rewrite, are you accounting for
the fact that a single "character" in a TextMorph can be any Morph?

Maui takes advantage of this feature for its built-in, mini word-processor.

On Wed, Oct 2, 2013 at 5:16 PM, Nicolas Cellier
<nicolas.cellier.aka.nice at gmail.com> wrote:
> Though leftMargin is nil and indentation are apparently set to zero, the
> TextMorph is always displayed with a small spacing from the left border and
> right border.
> This was quite long to find, but I now know:
>
> PluggableTextMorph>>resizeScroller
>     "Also needs to resize the text morph"
>
>     super resizeScroller.
>     textMorph ifNotNil:
>         [textMorph extent: (self innerBounds width-6)@self height].
>
> Unfortunately, this space is not available for displaying the cursor,
> because it does not belong to the TextMorph...
>
> The cursor is always displayed to the right of CharacterBlock.
> So when at the left of the line it is inside TextMorph bounds and visible
> because away from the borders thanks to above 3 pixels guard.
> At the right of the line, it is generally visible, unless your last
> character unluckily fits exactly to the right bound.
> But if you rightFlush/justify, the characters are then perfectly aligned,
> and the cursor to the right of a line becomes invisible.
>
> It would not be unreasonnable to add some small indents to the style rather
> than letting the 0, but I feel like the 6 pixels could be given back to the
> TextMorph with a settable property, so that the Cursor could be
> displayed....
>
> What do you think?
>
>
>


More information about the Squeak-dev mailing list