[BUG] [?] TextMorphs lose their font changes when used with scripting

Ned Konz ned at bike-nomad.com
Wed Apr 11 00:11:21 UTC 2001


If you make a script that changes the contents of a TextMorph, something like
	MyText's numeric value increase by 1
the existing TextStyle in the TextMorph is maintained, but the font changes 
disappear (possibly changing the font). This is noticeable if you've changed 
to any font but the smallest in a TextStyle, and makes it hard to use the 
TextMorphs naturally to read out values, etc.

My suggestion is below:

On Tuesday 10 April 2001 16:36, Ned Konz wrote:
> On Tuesday 10 April 2001 15:46, Dan Shafer wrote:
> > I went to make the changes you suggested. Switching from using an IV to
> > using the Text's numericValue has an unfortunate side effect: the display
> > of the Text's value loses its font information every time it is changed.
> > Any suggestions?
>
> Hmm... no... looks like TextMorph>>newContents: could stand to copy each of
> the attributes that start at the beginning of the text
> if the new contents is just a String. Since the textStyle is kept in an
> instance variable, this would make sense.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list