Newbie Q: wait

Ned Konz ned at bike-nomad.com
Sun Jul 13 02:55:18 UTC 2003


On Saturday 12 July 2003 07:17 pm, Bilal Ahmed wrote:
> Hi Ned,
>
> Thanks for your response.
>
> Basically what I have is a SystemWindow which displays a picture,
> followed by a fixed delay, and then a caption. This is repeated for
> a whole collection of picture-caption pairs.
>
> I tried stepping, where at each step I change the current picture
> to the next one in the collection. Is this the right idea? 

Sure. That'll work.

All you need to provide is:

* step -- this does whatever work is necessary
* stepTime -- the stepping period in milliseconds (say 3000 for your 
3second rate). You can change this dynamically if you want.

And when your Morph gets put into the World it should start stepping. 
Of course, like many things in Morphic, the SystemWindows may behave 
a bit differently, but try the above.

You can also do:

#startStepping 
#stopStepping

and also look at MorphicAlarm and its references. I think there's some 
methods on Morph that let you send yourself a one-time timed 
callback. This can be handy.

> (This
> doesn't currently work, but I probably need to give it some more
> time). Also, is there some place I can read up on stepping in
> general? I have only seen it applied in an example Edgar sent me.

You may want to look on the Squeak Swiki.
http://minnow.cc.gatech.edu/squeak/1257
http://minnow.cc.gatech.edu/squeak/1258
http://minnow.cc.gatech.edu/squeak/1262

> > * Assuming you're using Morphic, use a step method. It doesn't
> > have to be to a Morph; you can tell the World to start stepping
> > any arbitrary selector with arbitrary arguments at a given rate.
> > This is much better and the rest of the UI will still work.
> >
> >
> >
> > * Make a background task, and then arrange to communicate between
> > it and the user interface somehow. This will still probably
> > either require stepping on the Morphic side or
> > addDeferredUIMessage: (look up senders of it).

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list