Newbie Q: SimpleSliderMorph

Jon Hylands jon at huv.com
Thu Jul 24 14:03:40 UTC 2003


On Thu, 24 Jul 2003 09:38:10 -0400 (EDT), Bilal Ahmed
<bilal at dgp.toronto.edu> wrote:

> What I have presently is 
> levelSlider _ SimpleSliderMorph new color: (Color lightBlue);
> 	extent: 40 @ 20;
> 	target: self;
> 	actionSelector: #value:;
> 	adjustToValue: self value.		
> 
> That updates the instance variable value upon moving the slider. 
> 
> What I've tried with respect to UpdatingStringMorph is 
> 	valueString _ UpdatingStringMorph new.
> 	valueString contents: value printString. 
> 	self addMorphCentered: valueString. 
> 
> But it doesn't visually update the value when moving the slider (although 
> internally it is). Is there perhaps an easier way to approach this? Again, 
> all I'm hoping to do is show the value of value as it is updated.

Try this:

	valueString := UpdatingStringMorph on: self selector: #value.
	self addMorphCentered: valueString

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com



More information about the Squeak-dev mailing list