Hi, I have a little problem, I want to change the time by a "ClockMorph" Instance, I have searched a Methode in Squeak Categorie ClockMorph, which makes that, but I didn't find. for exemple of this way:" I get the contents of my clockMoprh, then I set these contents with the time that I want", is there a methode that make that, or I must writte it self.
|b| a := ClockMorph new. a showSeconds:false. b:=a getCharacters. a setCharacters:b with:'19:23'.---------------I want to have a Methode like that....so I can change the time.------ a openInWorld.
Thanks all for Help, Thanks Edgar.
Radouane.
___________________________________________________________________________ Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire. http://fr.mail.yahoo.com
On 6/5/06, radouane el marjani estel1212@yahoo.fr wrote:
I want to change the time by a "ClockMorph"
A ClockMorph displays the current system time. Do you mean to say that you want to change your system's idea of the time? That's probably not advisable, even if it's possible.
But I think you're wanting to make your own "clock" that could be set to any time you'd like, perhaps? You probably want to make your own object, similar to a ClockMorph, but which displays your chosen time instead of the system time. It may be useful to make an underlying model object which tracks the time, which a separate (Morph-descended) object simply displays, and perhaps changes.
Hope this helps!
--Tom Phoenix
On 6/5/06, radouane el marjani estel1212@yahoo.fr wrote:
Hi, I have a little problem, I want to change the time by a "ClockMorph" Instance, I have searched a Methode in Squeak Categorie ClockMorph, which makes that, but I didn't find. for exemple of this way:" I get the contents of my clockMoprh, then I set these contents with the time that I want", is there a methode that make that, or I must writte it self.
You can see how ClockMorph gets its content from the ClockMorph>>step method. Right now, it's hard-coded to use 'Time now'.
You could get the functionality you want by adding a new instance variable, 'time', and a new method 'time:' that'll set the variable.
Remember to set it to Time now in ClockMorph>>initialize too.
Duncan.
On 6/5/06, Duncan Mak duncanmak@gmail.com wrote:
You can see how ClockMorph gets its content from the ClockMorph>>step method. Right now, it's hard-coded to use 'Time now'.
You could get the functionality you want by adding a new instance variable, 'time', and a new method 'time:' that'll set the variable.
Remember to set it to Time now in ClockMorph>>initialize too.
Come to think of it, this will only work if you use blocks, because everytime step is called, a new Time needs to be calculated.
Duncan.
squeak-dev@lists.squeakfoundation.org