To be able to stop your application, you can include an Event Filter Node to include this functionality. To include this node, you can follow the next steps:
- Create an Event Structure in the Diagram Panel.
- Click on the Event Structure Case, and select Window as the event source. After you select the Window event source, another section titled Window will appear below the event sources.
- Under the Window section, click on the Event Type dropdown and select Filter Events >> Close >> Close?
The image below displays the steps followed above.
After selecting this Event Type, the Event Case Structure will show a Filter Event Node, as noted in the image below.
To add the functionality of closing the application when clicking the Close button, you can implement the following example.
If you wish to include a warning message to have the option to continue executing the application in the background or not, you can implement the Continue Background Execution Warning dialog box. This dialog box will look as the following image shows.
To include this dialog box, make sure the Background execution warning option is selected when builidng the application.