Creating Graphical User Interfaces Previous page   Next Page

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.


Previous page  Accessing Workspace Variables from a List Box Reading the Selections from the List Box Next page

© 1994-2005 The MathWorks, Inc.