NonRectangular Top Window


#1

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.

Thanks.
Y.


#2

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


#3

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.
Y.


#4

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.


#5

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?

Thanks.
Y.


#6

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


#7

Yes, it worked as I expected. Thanks.

Y.