Hi,
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
On Jun 14, 2007, at 8:59 , subbukk wrote:
Hi,
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.
Well, the canonical way is that you make a script for your Text that defines its behavior:
Text's numericValue <- Slider's numericValue
OTOH you can just bring up the halo on a watcher's readout and choose "change font" from its halo menu. You can even take the readout string out of the watcher using its black handle (or duplicate using the green one), it still works.
- Bert -
Hi --
There are two ways to do this. Texts have a setter for "numeric value".
[]
Even simpler (though a little more kludgy) is to get a "simple watcher" from the viewer that holds the property you wish to see, click to the "Updating String" (called "Readout String" in OLPC version), and use red menu to make the changes.
In "regular Etoys" a shift-click will get you this component, and you can use the red menu to change the font and size, etc.
In OLPC Etoys, use the red menu to "Unlock Readout String", then select it and use its red menu to change font and size.
Cheers,
Alan
At 11:59 PM 6/13/2007, subbukk wrote:
Hi,
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@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
Hi,
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 self setNumericValue: (Réglette getNumericValue asScaledDecimal: t1). self 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.
Regards
-------- Message d'origine-------- De: squeakland-bounces@squeakland.org de la part de subbukk Date: jeu. 14/06/2007 08:59 À: squeakland@squeakland.org Objet : [Squeakland] Value as Text
Hi,
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@squeakland.org http://squeakland.org/mailman/listinfo/squeakland
squeakland@lists.squeakfoundation.org