[squeak-dev] Re: Re: A better looking text caret (IMO)

Igor Stasenko siguctua at gmail.com
Mon Feb 25 14:46:11 UTC 2008


On 25/02/2008, Andrew Tween <amtween at hotmail.com> wrote:
>
>  "Igor Stasenko" <siguctua at gmail.com> wrote in message
>  news:4a5f5f320802240915g11780490i9ab393b5ed605da0 at mail.gmail.com...
>
> > http://bugs.squeak.org/view.php?id=6948
>
>
> I've added an implementation for a blinking caret to this mantis entry.

Cool! I didn't took a look on it yet. You noticed that blinking
requires redrawing text morph, which is suboptimal of course.
I perfect, there should be a single global caret morph. And text
morphs should talk to it in cases:
- focus changed (to relocate caret)
- selection changed (to hide caret when text range is selected, or
relocate to other point).

Then, we can use any custom shape to represent caret, and put choosing
different shapes in preferences.

A caret morph should not report any portion of screen as dirty (so
morphic will not try to redraw everything under it), instead, it
should take steps for preserving underlying pixels, and make sure to
hide itself when text morph is about to redraw, and show again when
draw cycle is idle.
A simple dead option could be to use bitXor operation when drawing
caret shape. So if you draw it twice, underlying pixels are unchanged.

>  Cheers,
>  Andy



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list