[osx/windowing] subclassing NSWindow and use it as delegate. make eventhandler global.