Event system problem?
Roel Wuyts
wuyts at iam.unibe.ch
Sun Jun 29 13:30:12 UTC 2003
Hello,
I am playing with the Squeak events system (NOT the one for Morphs!),
and I have the impression that something is wrong with unregestering
events...
Unregestering for actions work, as shown by the unit tests for the
events. But unregestering for individual objects seems to be broken,
unless these objects registered for the #changed: event.
For example, the following piece of code does not work as expected:
| eventSource dependentObject |
eventSource := EventManager new.
dependentObject := Object new.
"register - dependentObject becomes dependent"
eventSource
when: #anEvent send: #error to: dependentObject.
"unregister dependentObject"
eventSource removeDependent: dependentObject.
[eventSource triggerEvent: #anEvent]
on: Error
do: [:exc | self halt: 'Should not be!'].
--
Roel Wuyts Software
Composition Group
roel.wuyts at iam.unibe.ch University of Bern,
Switzerland
http://www.iam.unibe.ch/~wuyts/
Board Member of the European Smalltalk User Group: www.esug.org
More information about the Squeak-dev
mailing list
|