Callbacks for Specific Components
Callbacks for Specific Components
Coding the behavior of a UI component involves specific tasks that are unique to the type
of component you are working with. This topic contains simple examples of callbacks for
each type of component. The examples are written for GUIDE unless otherwise stated.
For general information about coding callbacks, see “Write Callbacks Using the GUIDE
Workflow” or “Write Callbacks Using the Programmatic Workflow”.
In this section...
“How to Use the Example Code” on page 8- 11
“Push Button” on page 8- 12
“Toggle Button” on page 8- 12
“Radio Button” on page 8- 13
“Check Box” on page 8- 14
“Edit Text Field” on page 8- 14
“Slider” on page 8- 15
“List Box” on page 8- 16
“Pop-Up Menu” on page 8- 18
“Panel” on page 8- 20
“Button Group” on page 8- 21
“Menu Item” on page 8- 22
“Table” on page 8- 25
“Axes” on page 8- 26
How to Use the Example Code
If you are working in GUIDE, then right-click on the component in your layout and select
the appropriate callback property from the View Callbacks menu. Doing so creates
an empty callback function that is automatically associated with the component. The
specific function name that GUIDE creates is based on the component’s Tag property, so
your function name might be slightly different than the function name in the example
code. Do not change the function name that GUIDE creates in your code. To use the
example code in your UI, copy the code from the example’s function body into your
function’s body.