Creating Graphical User Interfaces | ![]() ![]() |
The GUI Help Button
The GUI Help button callback displays an HTML file in the MATLAB help browser. It uses two commands:
which
command returns the full path to the file when it is on the MATLAB pathweb
command displays the file in the help browser. The following code is the Help button callback.
function varargout = HelpButton_Callback(h,eventdata,handles,varargin) HelpPath = which('f14ex_help.html'); web(HelpPath);
You can also display the help document in a web browser or load an external URL. See the web
documentation for a description of these options.
Closing the GUI
The GUI Close button callback closes the plot figure, if one exists and then closes the GUI. The handle of the plot figure and the GUI figure are available from the handles
structure. The callback executes two steps:
PlotFigure
field in the handles structure and if it contains a valid figure handle (the user could have closed the figure manually).The following code is the Close button callback.
function varargout = CloseButton_Callback(h,eventdata,handles,varargin)
% Close the GUI and any plot window that is open
if isfield(handles,'PlotFigure') & ishandle(handles.PlotFigure),
close(handles.PlotFigure);
end
close(handles.F14ControllerEditor);
![]() | Plotting the Results Data | The List Box Callback | ![]() |