[squeak-dev] [fix] Request for help: TextAnchor display broken in 3.9 and newer

Stéphane Rollandin lecteur at zogotounga.net
Fri Dec 19 13:10:10 UTC 2008

> * But is also unveils a rendering glitch.  Now that invisible characters 
> are being printed as boxes, the Workspace now prints one of those empty 
> boxes underneath your embedded morph.  This is probably because an 
> embedded morph is represented in a Text object by the Character value 2.

here is a handy method wrapping all is needed for anchoring a morph, 
returning a Text ready for display; the empty boxes are rendered 
invisible by setting their color to transparent.


   ^ (Character value: 1) asText
    addAttribute: (TextAnchor new anchoredMorph: self) from: 1 to: 1;
    addAttribute: (TextColor color: Color transparent) from: 1 to: 1.


More information about the Squeak-dev mailing list