in reply to Popup window for asking a question

but even though the new window comes up fine the original subroutines does not wait for an answer from the new window

That's the normal behaviour for a window. If you don't want that, you should create a dialog instead.

Armed with that knowledge, you should be able to find the documentation and examples yourself.