Implementation of MainWindow.