[Squeakland] RE : Value as Text

Dreyfuss Pierre-André (EDU) pierre-andre.dreyfuss at edu.ge.ch
Thu Jun 14 10:05:49 PDT 2007


The problem using the tile   text numeric value <-  Slider numericValue  is the number of decimals if numbers are not integers.

To adjust the number of decimals, you can make a script  with a parameter containing the smalltalk code :

decimals: t1 
		setNumericValue: (Réglette getNumericValue asScaledDecimal: t1).
		setCharacters: (self getCharacters truncateTo: (self getCharacters findString: 's')
					- 1)

See the attached project. The text as the script decimals: 5.

Use this tile in a script to adjust the number of decimals displayed. The text of course should contain a number.


-------- Message d'origine--------
De: squeakland-bounces at squeakland.org de la part de subbukk
Date: jeu. 14/06/2007 08:59
À: squeakland at squeakland.org
Objet : [Squeakland] Value as Text

How do I make a TextMorph track the numeric value of another Morph (say 
SliderMorph's numericValue or Holder's count)? This is so I could use larger 
fonts and sizes for the numbers.

Thanks in advance .. Subbu
Squeakland mailing list
Squeakland at squeakland.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DecimalText.001.pr
Type: application/download
Size: 38837 bytes
Desc: DecimalText.001.pr
Url : http://squeakland.org/pipermail/squeakland/attachments/20070614/1613f1a0/DecimalText.001-0001.bin

More information about the Squeakland mailing list