User`s guide
10 Examples of GUIDE GUIs
The example demonstrates the following GUI programm ing techniques:
• Uses open and save dialog boxes to provide a means for users to locate
and open the address book MAT -files and to save revised or new address
book MAT-files.
• Defines callbacks written for GUI menus.
• Uses the GUI’s
handles structure to save and recall shared data.
• Uses a GUI figure resize function.
Manage Shared Data
One of the key techniques illustrated in this example is how to keep track
of information and m ake it available to the various subfunctions. This
information includes:
• The name of the current MA T-file.
• The nam es and phone numbers stored in the MAT-file.
• An index pointer that indicates the current name and phone number, which
must be updated as the user pages through the address book.
• The figure position and size.
• The handles of all GUI components
The descriptions of the subfunctions that follow illustrate how to save and
retrieve information from the
handles structure. For more information on this
structure, see “handles Structure” on page 8-22 and “GUI Data” on page 9-7.
View and Run the Address Book Reader GUI
If you are reading this document in the M ATLAB Help browser, you can
access the exam ple FIG-file and code f ile by clicking the fo llowing links. If you
are reading this on the Web or in PD F for m, go to the corresponding section in
the MATLAB Help Browser to use the links.
If you intend to modify the layout or code of this GUI example, first save a
copy of its code file and FIG-file to your current folder (You need write access
to your current folder to do this.) Follow these steps to copy the example files
to your current folder and then to open them:
10-82