init code, raw main window