Add code to link main window to popout.