links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Direct Sensor Polling Cleanup Project
Last updated at 12:54 am UTC on 17 January 2006
Sam S. Adams posted this to the squeak-dev list on 2/24/2003 [bkv]

When experimenting with the EventRecorder it becomes obvious that lots of code in the image still assumes real-time polling of input events, MVC-style. A typical example is:

"Wait for the user to release any mouse button and then answer with the current location of the cursor."

[self anyButtonPressed] whileTrue:
[(Delay forMilliseconds: 50) wait].
^self cursorPoint

Which is called 32 times throughout the system, from old MVC code to Morphic. I have spent a couple of days digging through all the code, and am about to launch into an effort to clean this up so users of EventRecorder won't have so many surprises. The Morphic implementation of events handles almost everything, but I suppose there are a couple of hundred methods that ignore the event mechanism and go straight to the Sensor within while loops like the above.

Any ideas on an approach to solving this problem cleanly?

BTW, since whileTrue: and whileFalse: are inlined, whats the easiest way to find all senders?