Two windows in a program

I need to create, fundamentally, a separate window in which there will be a widget with buttons (something like a control panel). I create the second separate window SWindow in which I place the widget. When you press a button on the widget, the game stops, when button it is released - game continues. If this widget is placed in the main window, this does not happen. Is it possible to overcome it? And what can it be connected with?