Creating Graphical User Interfaces Previous page   Next Page

Setting Up the GUI with the Close Button

To set up the second GUI with a Close button, do the following:

  1. Select New from the File menu in the GUIDE Layout Editor.
  2. In the GUIDE Quick Start dialog, select Blank GUI (Default) and click OK. This opens the blank GUI in a new Layout Editor window.
  3. Drag a push button from the Component palette of the Layout Editor into the layout area.
  4. Right-click the push button and select Property Inspector from the pop-up menu.
  5. Change the String property to Close.
  6. Change the Tag property to close_pushbutton.
  7. Click the M-file editor icon on the toolbar of the Layout Editor.
  8. Click the callback icon on the toolbar of the M-file editor and select close_pushbutton_Callback from the menu.
  1. The following generated code for the close button callback should appear in the M-file editor:

  1. After these comments, add the following code:

Previous page  Setting Up the Close Confirmation Dialog Running the GUI with the Close Button Next page

© 1994-2005 The MathWorks, Inc.