You could use timer.simple, but that probably isn't best method for waiting. It would be better if you use a method to detect when the close button is pressed. Sorry I can't do the research to link how right now, I'm not at my normal computer setup this week.