window creation, application events and window event callbacks