Window flip?

As I transition from the snapshot of my window back to my window, I’m having trouble because as soon as I reset the title bar of the window to something other than 0, the snapshot I’m showing is pushed down by the title bar height. I’d like to tidy up my “real” window behind the snapshot, and then send the snapshot to the back.

Is there a way to have a component appear to stick to the 0,0 position in a window, regardless of title bar height?

No, it’s up to the OS to decide how it draws the title bar, you can’t go sticking anything on top of it.

I was under the impression (and I could be completely wrong) from working with SetNativeTitleBar that the native title bars were drawn by the system, and that the juce based ones were drawn by juce. This is just a guess based on the fact that window sizes change as you change the title bar type, with juce title bars requiring space within the main window, whereas native ones don’t.

So, I was thinking, if juce is drawing the title bar, then it might be possible to draw something on top of it…

Sorry, misunderstood you. Yes, of course if you’re not using a native title bar you can draw anything you want - just override the window’s paint() method and do whatever you need in there.

Overriding the window::paint() routine is a great idea!

Is there a way to temporarily suspend the drawing of the sub-components? I’d like to sort of hold a towel in front of the window while the main content component finishes dressing. Overriding the window::paint() routine works to an extent, but when I change the background color of the window, the whole thing gets redrawn, and that causes the half-dressed main component to show.

If you do all your painting/component set-up within the same event callback, then it won’t get repainted until the next paint callback.

Thanks a lot! for every reply.