proposal to bubble up events happening on shapes inside a composite - #156
proposal to bubble up events happening on shapes inside a composite#156Pynci wants to merge 1 commit into
Conversation
|
Thanks for this contribution. |
|
Why do you need this type check? |
|
Do you have tests showing the expected behavior? |
|
Not yet, I apologize |
|
Hi @Pynci let us know so I can review your changes with new tests |
|
|
||
| | theEventToSend | | ||
|
|
||
| (self parent isKindOf: RSComposite) ifTrue: [ self parent announce: anEventOrAnEventClassOrABlock ]. |
There was a problem hiding this comment.
It is good to avoid isKindOf: when possible. In this case, something like self parent bubbleEvent: anEventOrAnEventClassOrABlock can be a replacement.
There was a problem hiding this comment.
(However, I didn't analyze if my suggestion results in a proper implementation of bubbling, I am only talking of how to replace the isKindOf:.)
There was a problem hiding this comment.
Thanks for the suggestion! My pull request was in the first place a way to say "I found it often useful to have events bubbled up in the composite, does it make sense in the first place?". If you think it makes sense, I can then try to find a nice solution (avoiding type checks) :D
No description provided.