User`s guide

9 Managing and Sh aring Application Data in GUIDE
1 Click here to copy the files to your current folder.
2 Type guide slider box_ userdata or click here to ope n the GU I in GU ID E .
3 Type edit s lide rbox_userdata orclickheretoopentheGUIcodefilein
the Editor.
You can view the properties of any component by double-clicking it in the
Layout Editor to open the Property Inspector for it. You can modify either
the figure, GUI code, or both. Then you can save the GUI in your current
folder using File > Save as from GUIDE. This saves both files, allowing
you to rename them if you choose.
IfyoujustwanttoruntheGUIorinspectitinGUIDE,followthesesteps:
1 ClickheretoaddtheexamplefilestotheMATLABpath(onlyforthe
current session).
2 Clickheretorunthesliderbox_userdata GUI.
3 Click here to display the GUI in the GUIDE Layout Editor (read-only).
4 ClickheretodisplaytheGUIcodefileintheMATLABEditor(read-only).
Note Do n o t save GUI files to the examples folder where you fo und them,
or you will overwrite the original files. If you want to s ave the G UI files,
use File > Save as from GUIDE, which saves both the GUI FIG-file and
the GUI code file.
How Sharing D ata w ith UserData Works. Every GUI component,
and the figure itself, has a
UserData property that you can use to store
application-defined data. To access
UserData, a callback m ust know the
handle of the component with which the property is associated. The code uses
the
get function to retrieve UserDataand the set function to set it.
Note For more information, see “UserData Property” on page 9-5
9-12