add create_window hook to expose @window object