Clock ticker with Morphic
Dave Mason
dmason at sarg.ryerson.ca
Thu Oct 27 19:41:12 UTC 2005
I'm trying to do something that should be very simple. I have a clock
model that I want to tick over every second. Then I want to hand that
model to a Morphic viewer to display.
I initially set up a ticker process, based on some code in Mark
Guzdial's Squeak&MMA book, section 4.2. It worked fine, except
periodically morphic windows that were being updated would be trashed.
So, figuring that I had an unfortunate timing issue between the Morphic
updater and the asynch process, I changed my clock model to extend Morph
and use the #step method to update the clock (which led to a crash
documented on Mantis, but I was directed to a work-around). It now
works fine, except the step method gets called once for every view I
have open, as well as the intended one, so my clock goes up in
increments of 2 or 3 seconds per second.
My original thought was to have the ticker insert events into Morphic's
event queue, but (a) I couldn't quite track it down, and (b) from what I
found, it seemed to test the class of the events rather than simply
dispatch them.
Help!
Thanks ../Dave
More information about the Squeak-dev
mailing list
|