# TopLevelWindow : transparent its component from MouseEvent

**URL:** <https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262>\
**Category:** General JUCE discussion\
**Created:** [October 3, 2008, 6:42pm UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262 "2008-10-03T18:42:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![asair](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@asair](https://forum.juce.com/u/asair)\
**Post date:** [October 3, 2008, 6:42pm UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262/1 "2008-10-03T18:42:24Z")

</div>

I implemented both ResizableWindow and DocumentWindow sometimes ago.

At this step of my code : I was able to move my windows by catching them anywhere in their bodys, even if they were full of components.

and now I cannot.

Which attributes or options have I make disappear ?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 6, 2008, 4:33pm UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262/2 "2008-10-06T16:33:37Z")

</div>

I think it’ll let you drag it anywhere as long as the mouse event can reach the background. Probably you’ve changed the components inside so that they’re getting in the way of the mouse clicks now?

---

<div class="post-metadata">

**Author:** ![asair](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@asair](https://forum.juce.com/u/asair)\
**Post date:** [October 6, 2008, 4:36pm UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262/3 "2008-10-06T16:36:51Z")

</div>

Absolutely! Since I “componented” over the background I cannot move window.

So, It rules for me now, but I stay curious for knowing if it’s safety and easy to makle components transparent with mouse, in order to touch the background through a component (or give the illusion of it…)

But this is not an emergency.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 6, 2008, 5:54pm UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262/4 "2008-10-06T17:54:45Z")

</div>

Well yes, see Component::hitTest()

---

<div class="post-metadata">

**Author:** ![asair](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@asair](https://forum.juce.com/u/asair)\
**Post date:** [October 7, 2008, 8:45am UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262/5 "2008-10-07T08:45:07Z")

</div>

well, once you have tested the hit, how can you pass this as a direct mouse click on the window component ?

For example, I have an editable label upon the window titlebar.  
If i double click the label, i edit.  
If i click & move the label, i move the window…

which message have i to connect to hittest ?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [October 7, 2008, 12:22pm UTC](https://forum.juce.com/t/toplevelwindow-transparent-its-component-from-mouseevent/3262/6 "2008-10-07T12:22:06Z")

</div>

Well, no, it won’t work for that. To do something like that you’d need to make the window attach mouselisteners in cunning ways to detect drags on subcomponents. I’ve never tried doing anything like that but imagine that it could be a can of worms - you’d need to be very careful about which events you intercept.
