User`s guide
15 Examples of GUIs Created Programmatically
Code File Organi
zation
The iconEditor i
s programmed using nested functions. Its code is organized in
the following se
quence:
1 Comments displ
ayed in response to the
help command.
2 Data creation. Because the example uses n ested functions, defining this
data at the top level makes the data accessible to all functions without
having to pass them as arguments.
3 GUI figure and component creation.
4 Command lin
e input processing.
5 GUI initialization.
6 Block execution of the program until the GUI user clicks OK or Cancel.
7 Return ou
tput if requested.
8 Callback definitions. These callbacks, which service the GUI components,
are subfunctions of the
iconEditor function and so have access to the
data and component handles created at the top level, without their having
to be passed as arguments.
9 Helper function definitions. These helper functions are subfunctions o f the
iconEditor function and so have access to the data and component handles
created at the top level, without their having to be passed a s arguments.
Note For information about using nested functions, see “Nested Functions”.
GUI Programming Techniques
This topic explains the following GUI programming techniques as they are
used in the creation of the iconEditor.
• “Return Only After the User M akes a Choice” on page 15-71
• “Pass Input Arguments to a GUI” on page 15-72
15-70