MATLAB Creating Graphical User Interfaces

(Barry) #1
Lists of Items in a Programmatic UI

that to paste new items into a list, you must add them one at a time via the edit text box.
It also means you cannot copy the entire list and then paste it into another document.


You can save the entire contents of a list to a text file using File > Export list > to file.
That menu item's callback (lmfileexport) opens a standard file dialog to navigate to a
folder and specify a file name. Then, lmfileexport calls fopen, fprintf, and fclose
to create, write, and close the file.


Save the UI


You do not need to export a list to save it. The Save and Save as menu options save
lists by saving the entire UI. They call the saveas function to write the figure and all
its contents as a FIG-file to disk. You can reopen the saved UI by double-clicking it in
the Current Folder browser, or by calling hgload('figfilename.fig') from the
Command Line.

Free download pdf