Graphics Programs Reference
In-Depth Information
Figure8-9: A SimpleGUI.
Once saved, you can run the GUI from the Command Window by typing its
name, in our case plotgui , whether or not GUIDE is running. Both the .i
file and the . file must be in your current directory or MATLAB path. You
can also run it from the Layout Editor by typing CTRL+T or selecting Activate
Figure from the Tools menu. A copy of the GUI will appear in a separate
window, without all the surrounding menus and buttons of the Layout Editor.
(If you have added new objects since the last time you saved or activated
the GUI, the M-file associated to the GUI will also be brought to the front.)
Figure 8-9 shows how the GUI we created above looks when activated.
Notice that the appearance of the GUI is slightly different than in the
GUIDE window; in particular, the font size may differ. For this reason you
may have to go back to the GUIDE window after activating a GUI and resize
some objects accordingly. The changes you make will not immediately appear
in the active GUI; to see their effect you must activate the GUI again.
The objects you create in the Layout Editor are inert within that window —
you can't type text in the Edit Text box, you can't see the additional options by
clicking on the Popup Menu, etc. But in an activated GUI window, objects such
as Toggle Buttons and Popup Menus will respond to mouse clicks. However,
theywillnotactuallyperformanyfunctionsuntilyouwriteacallbackfunction
for eachof them.
Search WWH ::




Custom Search