basic event listener
exit button closes the main window