squeak redraw on ipaq after timeout

Andreas Raab squeak-dev at lists.squeakfoundation.org
Thu Sep 12 18:33:25 UTC 2002


Scott,

> 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.

"Date today" and "Time now" will do the trick. Since the internal clock
of the PDA won't sleep while the PDA is sleeping you should be able to
do something like:

PDAWorld>>initialize
	lastDate := Date today. "might sleep for more than a day"
	lastTime := Time now.

PDAWorld>>doOneCycle
	| nowDate nowTime |
	nowDate := Date today.
	nowTime := Time now.
	(lastDate ~= nowDate or:[nowTime seconds > (lastTime seconds
+5)])
		ifTrue:["redraw everything"].
	"..."

Cheers,
  - Andreas





More information about the Squeak-dev mailing list