DocumentWindow initial size setting


Something that i’ve noticed people getting confused by is the dimensions of the main content component in relation to the DocumentWindow’s dimensions. Obviously the titlebar and border make up the window face, and the content sits inside it - meaning the the dimensions of the content component are slightly smaller than those set when adding the window to the desktop.

Would it be possible to add a helper function to the DocumentWindow class to set the window size by specifying the intended dimensions of the content component? It would of course take into account the titlebar height and the border thickness; it would be a nice little timesaver.


Actually, it sort of already does that - if you call setContentComponent and set resizeToFit to true, then whenever you resize the content comp, the window follows suit.

But yes, it’d also be nice to have a setContentBounds method or something…