
Sharing Data Among a GUI’s Callbacks
9-7
Sharing Data Among a GUI’s Callbacks
You can use GUI data, application data, and the UserData property to share
data among a GUI’s callbacks. This topic shows you how for each of these data
forms:
• “GUI Data” on page 9-7
• “Application Data” on page 9-9
• “UserData Property” on page 9-11
See “Mechanisms for Managing Data” on page 9-2 for general information
about these data forms.
GUI Data
GUI data, which is managed by the guidata function, is accessible to all
callbacks of the GUI. A callback for one component can set a value in GUI data
which can then be read by a callback for another component. See “GUI Data”
on page 9-2 for more information about GUI data.
GUI Data Example: Passing Data Between a Slider and an Edit Text Box
This example uses a GUI that contains a slider and an edit text box as shown
in the following figure. A static text instructs the user to enter a value or click
the slider. The example uses GUI data to initialize and maintain an error
counter.
Komentáře k této Příručce