Compile and init main window