Updated test2 to draw on window events