squeak redraw on ipaq after timeout

Bob Arning squeak-dev at lists.squeakfoundation.org
Thu Sep 12 18:33:34 UTC 2002


On Thu, 12 Sep 2002 13:06:34 -0500 Scott Jaderholm =
<scott at jaderholm.com> wrote:
>* Andreas Raab (Andreas.Raab at gmx.de) wrote:
>> > I am pondering having squeak just refresh every 5 seconds or so, =
but I
>> > think that could be pretty annoying.
>>=20
>> Yup. But you could use the real-time clock to figure out when the =
last
>> time was that a world cycle occured. If that's been longer than five =
(or
>> perhaps rather fifteen) secs ago I'd say it's fine to refresh the =
entire
>> thing. If your app is zippy enough you may even go down to one sec or
>> so.
>
>Can you explain how to do this with some code?  I looked for real-time
>clock and world cycle on the swiki but didn't come up with anything
>useful.

WorldState>>doOneCycleNowFor: is where the code would go. Something =
like this:

	(LastCycleTime - Time millisecondClockValue) abs > (15 * 1000) ifTrue: =
[
		aWorld restoreMorphicDisplay
	].

right at the top of the method ought to do the trick.

Cheers,
Bob



More information about the Squeak-dev mailing list