I didn’t even know you could instantiate juce::DocumentWindow tbf, I’d always assumed it was an abstract type. I really wouldn’t recommend doing that though.
Assigning to the close button’s onClick method may work if you’re using a non-native title bar, but it almost certainly won’t work for the native buttons - hense why the closeButtonPressed() method exsists so you can be notified when either type of button is pressed.
Why do you want to use DocumentWindow as-is, out of interest?
Thank you for advice! I’ve made the subclass of DocumentWindow and overrided closeButtonPressed(). I need a sort of the pop-up window with FX properties. CalloutBox was non-obvious for me, so I decided to use DocumentWindow instead, as a holder of an actual content component with several widgets.