Graphics Programs Reference
In-Depth Information
(on-off) commands you could also use a Radio Button or a Checkbox , denoted
respectively by the buttons with a dot and a check mark in them. Finally, the
box on the right that says “equal” is a Popup Menu — we'll let you find its
button in the Layout Editor since it is hard to describe! Popup Menus and
Listbox objects allow you to let the user choose among several options.
We moved, resized, and in most cases changed the properties of each object
similarly to the way we described above. In the case of the Popup Menu, after
we selected the “String” button in the Property Inspector, we entered into the
window that appeared three words on three separate lines: equal , normal ,
and square .Usingmultiplelinesisnecessarytogivetheusermultiplechoices
in a Popup Menu or Listbox object.
In addition to populating your GUI withthe objects we described above, you
can create a menu bar for it using the Menu Editor, which you can open by
selecting Edit Menubar from the Layout menu. You can also use the Menu
Editor to create a context menu for an object; this is a menu that appears
when you click the right mouse button on the object. See the online
documentation for GUIDE to learn how to use the Menu Editor.
We also gave our GUI a title, which will appear in the titlebar of its window,
as follows. We clicked on the grid in the Layout Editor to select the entire GUI
(as opposed to an object within it) and went to the Property Inspector. There
we changed the text to the right of “Name” from “Untitled” to “Simple Plot
GUI”.
Saving and Running a GUI
To save a GUI, select Save As... from the File menu. Type a file name for your
GUI without any extension; for the GUI described above we chose lo i .
Saving creates two files, an M-file and a binary file withextension .i ,so
in our case the resulting files were named lo i. and lo i. i .
When you save a GUI for the first time, the M-file for the GUI will appear in
a separate Editor/Debugger window. We will describe how and why to modify
this M-file in the next section.
The instructions in this and the following section assume the default
settings of the Application Options, which you may have inspected
upon starting GUIDE, as described above. Otherwise, you can access
them from the Tools menu. We assume in particular that “Generate
.fig file and .m file”, “Generate callback function prototypes”, and
“Application allows only one instance to run” are selected.
Search WWH ::




Custom Search