Create a dependent window?

I want to create a secondary window which is free-floating in relation to the main window. But I also want it to close when the main window closes. Indeed, I want the application to end completely …