TextMorph code - help!

Bob Arning arning at charm.net
Fri Dec 21 05:24:01 UTC 2001


On Fri, 21 Dec 2001 03:13:08 -0000 "Gary McGovern" <garywork at lineone.net> wrote:
>When I code a TextMorph to openInWorld with ComicBold 24, it is always wrapped. What message is used so that it displays in a straight line. I can't find that message. 

Gary,

It depends on when and how you set the font. The example below works, but it didn't until I added the line noted. Before that it was composing the line (and thus the size of the TextMorph) based on the default font rather than ComicBold.

TextMorph new 
	contents: 'this is something longer than normal';
	fontName: #ComicBold size: 24;
	releaseCachedState;	"<----added"
	openInWorld

this also works:

TextMorph new 
	contents: '?';
	fontName: #ComicBold size: 24;
	contents: 'this is something longer than normal';
	openInWorld

Cheers,
Bob




More information about the Squeak-dev mailing list