User`s guide
A GUI That Manages List Data
List Master List Callbacks
The six callbacks not associated with m enu items are listed and described
below. Click any callback to view it in the M ATLAB Editor. The function
opens from the Creating Graphical Interfaces
examples folder.
Calback Function How Used
move_list_item
CalledbytheMoveUpandMoveDownpush
buttons to nudge items up and down list
enable_updown
Called from various subfunctions to enable and
disable the Move Up and Move Dow n buttons and
to keep the e dit text box and list box synchronized.
delete_list_item
Called from the Delete button to rem ove the
currently selected item from the list; it keeps it in
the edit text box in case the user decides to restore
it.
enter_edit
A KeypressFcn called by the edit text box when
user types a character; it sets the application data
Edit flag when the u ser ty pes Return.
commit_edit
A Callback called by the edit text box when user
types Return or clicks elsewhere; it checks the
application data
Edit flag set by enter_edit and
commits the edit text to the list only if Return
was the last key pressed. This avoids committing
edits inadvertently.
toggle_list_numbers
Callback
for the lmnumlistbtn check box, which
prefixes line numbers to list items or removes
them, depending on value of the check box
Identify Component Handles. A common characteristic of these and other
List Master subfunctions is their way of obtaining handles for components.
Rather than using the
guidata function, which many GUIs use to share
handles and other data for components, these subfunctions get handles they
need dynamically by looking them up from their Tags, which are hard-coded
and never vary. The code that finds handles uses the following pattern:
15-47