| Contents | Index |
h = dialog('PropertyName',PropertyValue,...)
h = dialog('PropertyName',PropertyValue,...) returns a handle to a dialog box. The dialog box is a figure graphics object with properties recommended for dialog boxes. You can specify any valid figure property value except DockControls, which is always off.
The properties that dialog sets and their values are
| Property | Value |
|---|---|
| 'ButtonDownFcn' | 'if isempty(allchild(gcbf)), close(gcbf), end' |
| 'Colormap' | [] |
| 'Color' | DefaultUicontrolBackgroundColor |
| 'DockControls' | 'off' |
| 'HandleVisibility' | 'callback' |
| 'IntegerHandle' | 'off' |
| 'InvertHardcopy' | 'off' |
| 'MenuBar' | 'none' |
| 'NumberTitle' | 'off' |
| 'PaperPositionMode' | 'auto' |
| 'Resize' | 'off' |
| 'Visible' | 'on' |
| 'WindowStyle' | 'modal' |
Note By default, the dialog box is modal. A modal dialog box prevents the user from interacting with other windows before responding. For more information, see WindowStyle in the MATLAB Figure Properties. |
The default ButtonDownFcn, if isempty(allchild(gcbf)), close(gcbf), end, causes the dialog to terminate itself when clicked as long as it contains no child objects. Replace it with another callback or an empty callback if you do not want this behavior. You can do this only from a script or function if the dialog is modal (the default WindowStyle).
Any property you can specify for the figure function is valid for this function.
Create a default modal dialog box:
out = dialog;
Create a nonmodal dialog box with a name on its title bar:
out = dialog('WindowStyle', 'normal', 'Name', 'My Dialog');errordlg | figure | helpdlg | inputdlg | listdlg | msgbox | questdlg | uiresume | uiwait | warndlg

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |