Adjust the mainwindow. Add ProcessEvents