Skip to Main Content Skip to Search
Product Documentation

dialog - Create and display empty dialog box

Syntax

h = dialog('PropertyName',PropertyValue,...)

Description

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

PropertyValue
'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'

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.

Examples

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');

See Also

errordlg | figure | helpdlg | inputdlg | listdlg | msgbox | questdlg | uiresume | uiwait | warndlg

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS