NonRectangular Top Window

Hallo everyone!

I’m pretty much sure someone must already have asked this question, but I seem to be unable to find the answer here on the forums.

I would like to create a Top Window that has a non-rectangular shape. Could someone point me to the correct way to implement this?
Any pointers will be appreciated.


call setOpaque(false), and only draw the opaque part.

Thanks. But now when I run my code it fails on assertion in DropShadower::setOwner()

jassert (owner->isOpaque()); // doesn't work properly for semi-transparent comps!

When I click Continue (in VS) I’m able to see the window as I wanted to, but with a shadow. Is there a way of turning off the top window Shadower completely to get rid of the jassert()? I can’t seem to be able to find it in the Docs…

Thanks again.

Just use your own component. The ResizableWindow, DocumentWindow, etc, are all designed to be opaque, so not much point in trying to hack them to be a different shape.

Thanks Jules.

What would you advice? Start from scratch with Component class or should I try a TopLevelWindow class as my base. In Docs it says that “A top-level window also has an optional drop-shadow.” which in my case would be fine as long as its turned off. Or can you see a possible pitfall I might fall into when going with the TopLevelWindow as my base?


Yeah, TopLevelWindow is probably ok if you just turn off its shadow.

Yes, it worked as I expected. Thanks.