-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#when:do API #257
Comments
It happened to me once, I agree we can answer the handler. Also, I wonder we need an additional change in this API... In Pharo 12, @tesonep ? |
How to remove a when:do: listener? I propose to do that: BlElement>>when: anEventClass do: aBlock
^ self addEventHandlerOn: anEventClass do: aBlock Of course this on TBlEventTarget trait |
After to discuss with @plantec, it's appears than when:do: should be deprecated because this is not symmetric and a little confusing because the add handler is not clear. |
instead of when:do: one should use addEventHandler: as in: then one can remove the handler nicely with: |
|
Hello, when you call a #when:do: on a BlElement, the method calls a #addEventHandlerOn:do: without returning the instance of eventHandler recorded. It must be returned in order do removal on some events handlers.
example :
self when: BlMouseMoveEvent do: [ :event | self mouseMovedTo: event ]
returns the receiver (self) of the message...
The text was updated successfully, but these errors were encountered: