Tweak events (was Re: Viewing in Morphic)
bert at freudenbergs.de
Tue Nov 14 11:03:05 UTC 2006
(separating this from the Morphic discussion)
On Nov 14, 2006, at 11:22 , Juan Vuletich wrote:
> Hi Andreas,
> Andreas Raab escribió:
>> I presume that by "the receiver of the message for some object was
>> always the object triggering the event" you mean that the signaler
>> and the handler of the event are the same (if not, please clarify).
>> If that's what you mean then you are right, usually they are not
>> the same. This is why you have <on: eventName in: signaler>
>> annotations (and the common <on: eventName> is effectively
>> shorthand for <on: eventName in: self>).
> I missed that. How do you reference signaler? I mean, each instance
> of the handler could want events from a particular signaler,
> perhaps one that still doesn't exist when you compile the method!
> Perhaps it is an instance variable of the handler?
Yes, it is like an instance variable (actually a field, which is used
exactly like an instance variable but generates change events on
When compiling, only existing instances are updated. But when
creating a new instance, the field will be nil, so no event handlers
will be registered for that event, yet. But a second event handler is
installed that handles a change event for that field - it will
register the actual event handler as soon as you assign to the field.
This is an example for what Andreas meant with "indeed, part of the
implementation of Tweak depends on objects 'viewing themselves'".
This is totally non-graphical, it takes the model/view separation
idea down to the system core itself.
- Bert -
More information about the Squeak-dev