views:

133

answers:

1

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.

+2  A: 

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)

  1. Record the event, tab the transparent image away, and replay the event. This seems like an inefficient and poor way of doing it.
  2. Somehow keep track of what has focus behind your transparent image, and pass the event to it. I'm not familiar with the libraries in question, so I don't know if it's possible to do it like that. If you have control over the other layers, this is most likely the way to go. (You can directly call their 'a mouse event happened' functions with that mouseDownEvent, though you do still have to identify which one would receive it).
  3. Simply declare it as something that doesn't get mouse events passed to it at whatever level is available. OSD windows tend to do this, I'm not sure how. If you can do it this way, I would advise it... but given that you're asking this question, you probably can't.
zebediah49