MATLAB Release Notes |
Creating Graphical User Interfaces (GUIDE) Features
MATLAB 6.5 adds the following features and enhancements to GUIDE:
Changes to the M-file Generated by GUIDE
The associated M-file generated by GUIDE has the following differences for Release 13:
varargin
argument. If you want to add more arguments to a callback subfunction, you must add the arguments to the function definition.
The following sections describe changes to the associated M-file in greater detail.
New Calling Syntax for GUI M-File. You can call the GUI M-file with the following syntax:
my_gui my_gui('PropertyName', PropertyValue,...) my_gui(UserArgs,...) my_gui('PropertyName',PropertyValue,...,UserArgs,...)
my_gui('Property', Value,...)
, where 'Property'
is a valid figure property, creates a new my_gui
using the given property value pairs.
my_gui('My_function', hObject, eventdata, handles)
calls the subfunction my_function
in the GUI M-file with the given input arguments.
Opening Function Code. The generated GUI M-file now includes a subfunction for any initialization code you want to execute. If you call the GUI with input arguments, they are passed to the opening function. The GUI M-file calls the opening function with the following arguments:
hObject
--handle to figure
eventdata
--to be defined in a future version of MATLAB
handles
--structure with handles and user data (see guidata
)
varargin
-- command line arguments to my_gui (see varargin
)
Output Function Code. The GUI M-file now includes a subfunction for passing output arguments to the command line. The GUI M-file calls the output function with the following arguments:
hObject
--handle to figure
eventdata
--to be defined in a future version of MATLAB
handles
--structure with handles and user data (see guidata
)
varargin
--unrecognized property name/value pairs from the command line
GUIDE Quick Start Dialog and Templates
GUIDE now provides four templates that make it easier to construct GUIs. The templates are simple examples of GUIs that you can modify for your purposes. You can access the templates from the new GUIDE Quick Start dialog that appears when you open GUIDE, or when you select New from the file menu. It is often easier to build a GUI from an existing template rather than starting with a blank GUI.
openfig Accepts Property Name/Value Pair--Returns User Args
The openfig
function enables you to specify figure property name/value pairs that are applied to the figure before it is displayed. See the openfig
reference page for more information.
uiputfile and uigetfile Return Filter Index
The uigetfile
and uiputfile
functions can now optionally return an index value that enables you to determine which filter was selected by the user. See the uigetfile
and uiputfile
reference pages for more information.
uigetdir
The new uigetdir
function displays a dialog box in which the user can select a directory, and returns the directory name as a string.
External Interfaces/API Features | Major Bug Fixes |