added window structure change events and allowed resizing the window