Creating Graphical User Interfaces    

How the GUI and Dialog Work

This section describes what occurs when you click the Close button on the GUI:

  1. User clicks the Close button. Its callback then
  2. The modal dialog opens with the 'Position' obtained from the GUI that calls it.
  3. The opening function in the modal dialog M-file:
  4. When a user clicks one of the two push buttons, the callback for the push button
  5. The output function is called, which returns the string Yes or No as an output argument, and deletes the dialog with the command
  1. delete(handles.figure1)

  1. When the GUI with the Close button regains control, it receives the string Yes or No. If the answer is 'No', it does nothing. If the answer is 'Yes', the close button callback closes the GUI with the command
  1. delete(handles.figure1)

For more information on programming GUIs, see Programming GUIs.


  Running the GUI with the Close Button Example: Displaying an Image File