pharo4Stef@free.fr wrote
Why not just a StringMorph with correct background?
That doesn't look possible with the current implementation. It just draws
the string with no background:
StringMorph>>#drawOn: aCanvas
...
"super drawOn: aCanvas. <- This line doesn't exist"
aCanvas drawString: contents in: bnd font: self fontToUse color: color.
>From the "... color: color" above, it looks like StringMorph is hijacking
the instVar it inherited from Morph, which usually means background color,
to use for the text color.
If you hack drawOn: to
...
self color: Color white.
super drawOn: aCanvas.
aCanvas drawString: contents in: bnd font: self fontToUse color: Color
black.
you get the halo label you're looking for but of course break everything
else.
So I think that if we want StringMorphs to have backgrounds, we have to add
a textColor instVar, initialize color to Color transparent, and rewrite all
color assignments in StringMorph to set textColor.
In short: not for 3.0.
I agree that such deep changes can't be done at this late stage.
However the fix I described is low impact. Is that reasonable to do as
a temporary measure for 3.0 release, and a case opened to clean up in
4.0? The class name could even be TemporaryOpaqueStringMorph with
appropriate class comment. I know I've left it late, but its annoyed
me for months while I was working on other priority cases in the
tracker.