main(){
    NXApp = [MyApp new];
    window = [NXApp mainWindow];
    mask = [window eventMask];
    [NXApp run];
    ...