Specifications

1 Getting Started with GUIDE
1-34
scrollbar). This means the callback is executed after the first click of a
double-click on a single item or when the user is making multiple selections.
In these situations, you need to add another component, such as a
Done button
(push button) and program its callback routine to query the list box
Value
property (and possibly the figure
SelectionType property) instead of creating
a callback for the list box. If you are using the automatically generated
application M-file option, you need to either:
Set the list box
Callback property to the empty string ('') and remove the
callback subfunction from the application M-file.
Leave the callback subfunction stub in the application M-file so that no code
executes when users click on list box items.
The first choice is best if you are sure you will not use the list box callback and
you want to minimize the size and efficiency of the application M-file. However,
if you think you may want to define a callback for the list box at some time, it
is simpler to leave the callback stub in the M-file.
See The Listbox Callback for an example of how to program a list box to open
files.
List Box Examples
See the following examples for more information on using list boxes:
List Box Directory Reader – shows how to creates a GUI that displays the
contents of directories in a list box and enables users to open a variety of file
types by double-clicking on the filename.
Accessing Workspace Variables from a List Box – shows how to access
variables in the MATLAB base workspace from a list box GUI.
Popup Menus
Popup menus open to display a list of choices when users press the arrow.
The
String property contains the list of string displayed in the popup menu.
The
Value property contains the index into the list of strings that correspond
to the selected item.