Implemented functionality to draw the window.