[email protected] 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.



-----
Cheers,
Sean
--
View this message in context: 
http://forum.world.st/13204-Hard-to-see-Morph-halo-label-tp4755115p4755242.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Reply via email to