Creating Graphical User Interfaces |
Reading Workspace Variables
When the GUI initializes, it needs to query the workspace variables and set the list box String
property to display these variable names. Adding the following subfunction to the GUI M-file accomplishes this using evalin
to execute the who
command in the base workspace. The who
command returns a cell array of strings, which are used to populate the list box.
The function's input argument is the handles
structure generated by the GUI M-file. This structure contains the handle
of the list box, as well as the handles
all other components in the GUI.
The callback for the Update Listbox push button also calls update_listbox
.
Accessing Workspace Variables from a List Box | Reading the Selections from the List Box |