U: make window as a global.
Fix: fixed #18, event supports