I have an image for a Squeak Morphic GUI that contains some transparent parts and thus should not accept any mouseevents etc. but just be visible, but it needs to be visible in front of other morphs.
That's why i thought it would be useful to propagate the appearing mouseevents to the underlying morphs. Does anyone know a solution for my problem or another suggestion to solve it.
V <- mouseDownEvent
_____________________________ <- transparent image (BorderedMorph)
_____ _____ _____
_| |___| |___| |__ <- buttons waiting for click and drop events
_____________________________ <- basic morph
i hope that illustrates my problem.
The best thing I can think of is something along the following lines (in increasing order of smoothness, and decreasing order of likelihood to work)
By default, Morphic mouse events are handled in the top-most morph. However, a parent morph is able to intercept #mouseDown
to children using #mouseDownPriority
.
Your transparent image gets all clicks because it is top-most. Take a look at #rejectsEvent:
. It justs combines #isLocked
and #visible
to reject events. You may want to override this in order to reject events even if visible.
For example:
MyMorph>>rejectsEvent: anEvent
^ true "Ignores all events."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With