added functionality for exiting the main-loop of a container
leave message box if a button is pressed and return the button type