Here’s what happens normally. For my window’s constructor, I do this:
ConsoleWindow::ConsoleWindow(ehw *dev) :
DocumentWindow(T("Console"),
Colours::white,
minimiseButton | closeButton,
false)
and inside the constructor :
[code]CwContent *comp;
setOpaque(true);
setSize(w,h);
comp = new CwContent(_layout,dev,_session);
comp->setSize(w,h);
setContentComponent(comp,false,true);
[/code]
Once I’ve built the window, my application does this:
[code]window->addToDesktop( ComponentPeer::windowAppearsOnTaskbar |
ComponentPeer::windowHasTitleBar |
ComponentPeer::windowHasCloseButton |
ComponentPeer::windowHasMinimiseButton |
ComponentPeer::windowHasDropShadow);
window->setTopLeftPosition(xoffset,yoffset);
window->setVisible(true);
window->toFront(true);
[/code]
One thing that changed with 1.29 was that I have to call setSize twice - once for the window and then again for the content component. The content component has a fixed size, so I was expecting that I could just set the size of the content component and then set the resizeToFit parameter to true. It looks like the DocumentWindow isn’t resized properly on the call to setContentComponent unless the window has a non-zero size first; it ends up not being tall enough.
For the native stuff, I get different results depending on when I do things.
If I call setUsingNativeTitleBar(true) just before the addToDesktop call, I get the double title bar - the native one on top and the JUCE one right below it. My content component is right under the JUCE title bar.
If I call setUsingNativeTitleBar(true) right after the addToDesktop call, I get a window that’s too tall - my content component is right up under the native title bar and there’s a blue bar at the bottom of the window about the size of the JUCE title bar.
Matt