Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 641ebb3060c35990cc021d8f7aaf9aca > files > 289

octave-doc-5.1.0-7.1.mga7.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>I/O Dialogs (GNU Octave (version 5.1.0))</title>

<meta name="description" content="I/O Dialogs (GNU Octave (version 5.1.0))">
<meta name="keywords" content="I/O Dialogs (GNU Octave (version 5.1.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="GUI-Development.html#GUI-Development" rel="up" title="GUI Development">
<link href="Progress-Bar.html#Progress-Bar" rel="next" title="Progress Bar">
<link href="GUI-Development.html#GUI-Development" rel="prev" title="GUI Development">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<a name="I_002fO-Dialogs"></a>
<div class="header">
<p>
Next: <a href="Progress-Bar.html#Progress-Bar" accesskey="n" rel="next">Progress Bar</a>, Up: <a href="GUI-Development.html#GUI-Development" accesskey="u" rel="up">GUI Development</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="I_002fO-Dialogs-1"></a>
<h3 class="section">35.1 I/O Dialogs</h3>

<p>Simple dialog menus are available for choosing directories or files.  They
return a string variable which can then be used with any command requiring
a filename.
</p>
<a name="index-dialog_002c-displaying-a-dialog-for-selecting-directories"></a>
<a name="XREFuigetdir"></a><dl>
<dt><a name="index-uigetdir"></a><em><var>dirname</var> =</em> <strong>uigetdir</strong> <em>()</em></dt>
<dt><a name="index-uigetdir-1"></a><em><var>dirname</var> =</em> <strong>uigetdir</strong> <em>(<var>init_path</var>)</em></dt>
<dt><a name="index-uigetdir-2"></a><em><var>dirname</var> =</em> <strong>uigetdir</strong> <em>(<var>init_path</var>, <var>dialog_name</var>)</em></dt>
<dd><p>Open a GUI dialog for selecting a directory.
</p>
<p>If <var>init_path</var> is not given the current working directory is used.
</p>
<p><var>dialog_name</var> may be used to customize the dialog title.
</p>
<p><strong>See also:</strong> <a href="#XREFuigetfile">uigetfile</a>, <a href="#XREFuiputfile">uiputfile</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-dialog-for-selecting-files"></a>
<a name="XREFuigetfile"></a><dl>
<dt><a name="index-uigetfile"></a><em>[<var>fname</var>, <var>fpath</var>, <var>fltidx</var>] =</em> <strong>uigetfile</strong> <em>()</em></dt>
<dt><a name="index-uigetfile-1"></a><em>[&hellip;] =</em> <strong>uigetfile</strong> <em>(<var>flt</var>)</em></dt>
<dt><a name="index-uigetfile-2"></a><em>[&hellip;] =</em> <strong>uigetfile</strong> <em>(<var>flt</var>, <var>dialog_name</var>)</em></dt>
<dt><a name="index-uigetfile-3"></a><em>[&hellip;] =</em> <strong>uigetfile</strong> <em>(<var>flt</var>, <var>dialog_name</var>, <var>default_file</var>)</em></dt>
<dt><a name="index-uigetfile-4"></a><em>[&hellip;] =</em> <strong>uigetfile</strong> <em>(&hellip;, &quot;Position&quot;, [<var>px</var> <var>py</var>])</em></dt>
<dt><a name="index-uigetfile-5"></a><em>[&hellip;] =</em> <strong>uigetfile</strong> <em>(&hellip;, &quot;MultiSelect&quot;, <var>mode</var>)</em></dt>
<dd>
<p>Open a GUI dialog for selecting a file and return the filename <var>fname</var>,
the path to this file <var>fpath</var>, and the filter index <var>fltidx</var>.
</p>
<p><var>flt</var> contains a (list of) file filter string(s) in one of the following
formats:
</p>
<dl compact="compact">
<dt><code>&quot;/path/to/filename.ext&quot;</code></dt>
<dd><p>If a filename is given then the file extension is extracted and used as
filter.  In addition, the path is selected as current path and the filename
is selected as default file.  Example: <code>uigetfile (&quot;myfun.m&quot;)</code>
</p>
</dd>
<dt>A single file extension <code>&quot;*.ext&quot;</code></dt>
<dd><p>Example: <code>uigetfile (&quot;*.ext&quot;)</code>
</p>
</dd>
<dt>A 2-column cell array</dt>
<dd><p>containing a file extension in the first column and a brief description in
the second column.
Example: <code>uigetfile ({&quot;*.ext&quot;, &quot;My Description&quot;;&quot;*.xyz&quot;,
&quot;XYZ-Format&quot;})</code>
</p>
<p>The filter string can also contain a semicolon separated list of filter
extensions.
Example: <code>uigetfile ({&quot;*.gif;*.png;*.jpg&quot;, &quot;Supported Picture
Formats&quot;})</code>
</p>
</dd>
<dt>A directory name or path name</dt>
<dd><p>If the folder name of path name contains a trailing file separator, the
contents of that folder will be displayed.  If no trailing file separator
is present the parent directory is listed.  The substring to the right of
the rightmost file separator (if any) will be interpreted as a file or
directory name and if that file or directory exists it will be highlighted.
If the path name or directory name is wholly or partly nonexistent, the
current working directory will be displayed.
No filter will be active.
</p></dd>
</dl>

<p><var>dialog_name</var> can be used to customize the dialog title.
</p>
<p>If <var>default_file</var> is given then it will be selected in the GUI dialog.
If, in addition, a path is given it is also used as current path.
</p>
<p>The screen position of the GUI dialog can be set using the
<code>&quot;Position&quot;</code> key and a 2-element vector containing the pixel
coordinates.  Two or more files can be selected when setting the
<code>&quot;MultiSelect&quot;</code> key to <code>&quot;on&quot;</code>.  In that case <var>fname</var> is a
cell array containing the files.
</p>
<p><strong>See also:</strong> <a href="#XREFuiputfile">uiputfile</a>, <a href="#XREFuigetdir">uigetdir</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-dialog-for-storing-files"></a>
<a name="XREFuiputfile"></a><dl>
<dt><a name="index-uiputfile"></a><em>[<var>fname</var>, <var>fpath</var>, <var>fltidx</var>] =</em> <strong>uiputfile</strong> <em>()</em></dt>
<dt><a name="index-uiputfile-1"></a><em>[<var>fname</var>, <var>fpath</var>, <var>fltidx</var>] =</em> <strong>uiputfile</strong> <em>(<var>flt</var>)</em></dt>
<dt><a name="index-uiputfile-2"></a><em>[<var>fname</var>, <var>fpath</var>, <var>fltidx</var>] =</em> <strong>uiputfile</strong> <em>(<var>flt</var>, <var>dialog_name</var>)</em></dt>
<dt><a name="index-uiputfile-3"></a><em>[<var>fname</var>, <var>fpath</var>, <var>fltidx</var>] =</em> <strong>uiputfile</strong> <em>(<var>flt</var>, <var>dialog_name</var>, <var>default_file</var>)</em></dt>
<dd><p>Open a GUI dialog for selecting a file.
</p>
<p><var>flt</var> contains a (list of) file filter string(s) in one of the following
formats:
</p>
<dl compact="compact">
<dt><code>&quot;/path/to/filename.ext&quot;</code></dt>
<dd><p>If a filename is given the file extension is extracted and used as filter.
In addition the path is selected as current path and the filename is
selected as default file.  Example: <code>uiputfile (&quot;myfun.m&quot;)</code>
</p>
</dd>
<dt><code>&quot;*.ext&quot;</code></dt>
<dd><p>A single file extension.
Example: <code>uiputfile (&quot;*.ext&quot;)</code>
</p>
</dd>
<dt><code>{&quot;*.ext&quot;, &quot;My Description&quot;}</code></dt>
<dd><p>A 2-column cell array containing the file extension in the 1st column and
a brief description in the 2nd column.
Example: <code>uiputfile ({&quot;*.ext&quot;,&quot;My Description&quot;;&quot;*.xyz&quot;,
&quot;XYZ-Format&quot;})</code>
</p></dd>
</dl>

<p>The filter string can also contain a semicolon separated list of filter
extensions.
Example: <code>uiputfile ({&quot;*.gif;*.png;*.jpg&quot;,
&quot;Supported Picture Formats&quot;})</code>
</p>
<p><var>dialog_name</var> can be used to customize the dialog title.
If <var>default_file</var> is given it is preselected in the GUI dialog.
If, in addition, a path is given it is also used as current path.
</p>
<p><strong>See also:</strong> <a href="#XREFuigetfile">uigetfile</a>, <a href="#XREFuigetdir">uigetdir</a>.
</p></dd></dl>


<p>Additionally, there are dialog boxes for displaying help messages, warnings, or
errors, and for getting text input from the user.
</p>
<a name="index-dialog_002c-displaying-an-error-dialog"></a>
<a name="XREFerrordlg"></a><dl>
<dt><a name="index-errordlg"></a><em></em> <strong>errordlg</strong> <em>()</em></dt>
<dt><a name="index-errordlg-1"></a><em></em> <strong>errordlg</strong> <em>(<var>msg</var>)</em></dt>
<dt><a name="index-errordlg-2"></a><em></em> <strong>errordlg</strong> <em>(<var>msg</var>, <var>title</var>)</em></dt>
<dt><a name="index-errordlg-3"></a><em></em> <strong>errordlg</strong> <em>(<var>msg</var>, <var>title</var>, <var>opt</var>)</em></dt>
<dt><a name="index-errordlg-4"></a><em><var>h</var> =</em> <strong>errordlg</strong> <em>(&hellip;)</em></dt>
<dd><p>Display an error dialog box with error message <var>msg</var> and caption
<var>title</var>.
</p>
<p>The default error message is <code>&quot;This is the default error string.&quot;</code>
and the default caption is <code>&quot;Error Dialog&quot;</code>.
</p>
<p>The error message may have multiple lines separated by newline characters
(&quot;\n&quot;), or it may be a cellstr array with one element for each line.
</p>
<p>The third optional argument <var>opt</var> controls the behavior of the dialog.
See <code>msgbox</code> for details.
</p>
<p>The return value <var>h</var> is a handle to the figure object used for
building the dialog.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">errordlg (&quot;Some fancy error occurred.&quot;);
errordlg (&quot;Some fancy error\nwith two lines.&quot;);
errordlg ({&quot;Some fancy error&quot;, &quot;with two lines.&quot;});
errordlg (&quot;Some fancy error occurred.&quot;, &quot;Fancy caption&quot;);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFhelpdlg">helpdlg</a>, <a href="#XREFwarndlg">warndlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFinputdlg">inputdlg</a>, <a href="#XREFlistdlg">listdlg</a>, <a href="#XREFquestdlg">questdlg</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-help-dialog"></a>
<a name="XREFhelpdlg"></a><dl>
<dt><a name="index-helpdlg"></a><em></em> <strong>helpdlg</strong> <em>()</em></dt>
<dt><a name="index-helpdlg-1"></a><em></em> <strong>helpdlg</strong> <em>(<var>msg</var>)</em></dt>
<dt><a name="index-helpdlg-2"></a><em></em> <strong>helpdlg</strong> <em>(<var>msg</var>, <var>title</var>)</em></dt>
<dt><a name="index-helpdlg-3"></a><em><var>h</var> =</em> <strong>helpdlg</strong> <em>(&hellip;)</em></dt>
<dd><p>Display a help dialog box with help message <var>msg</var> and caption
<var>title</var>.
</p>
<p>The default help message is <code>&quot;This is the default help string.&quot;</code>
and the default caption is <code>&quot;Help Dialog&quot;</code>.
</p>
<p>The help message may have multiple lines separated by newline characters
(&quot;\n&quot;), or it may be a cellstr array with one element for each line.
</p>
<p>The return value <var>h</var> is a handle to the figure object used for
building the dialog.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">helpdlg (&quot;Some helpful text for the user.&quot;);
helpdlg (&quot;Some helpful text\nwith two lines.&quot;);
helpdlg ({&quot;Some helpful text&quot;, &quot;with two lines.&quot;});
helpdlg (&quot;Some helpful text for the user.&quot;, &quot;Fancy caption&quot;);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFwarndlg">warndlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFinputdlg">inputdlg</a>, <a href="#XREFlistdlg">listdlg</a>, <a href="#XREFquestdlg">questdlg</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-an-input-dialog"></a>
<a name="XREFinputdlg"></a><dl>
<dt><a name="index-inputdlg"></a><em><var>cstr</var> =</em> <strong>inputdlg</strong> <em>(<var>prompt</var>)</em></dt>
<dt><a name="index-inputdlg-1"></a><em><var>cstr</var> =</em> <strong>inputdlg</strong> <em>(<var>prompt</var>, <var>title</var>)</em></dt>
<dt><a name="index-inputdlg-2"></a><em><var>cstr</var> =</em> <strong>inputdlg</strong> <em>(<var>prompt</var>, <var>title</var>, <var>rowscols</var>)</em></dt>
<dt><a name="index-inputdlg-3"></a><em><var>cstr</var> =</em> <strong>inputdlg</strong> <em>(<var>prompt</var>, <var>title</var>, <var>rowscols</var>, <var>defaults</var>)</em></dt>
<dt><a name="index-inputdlg-4"></a><em><var>cstr</var> =</em> <strong>inputdlg</strong> <em>(<var>prompt</var>, <var>title</var>, <var>rowscols</var>, <var>defaults</var>, <var>options</var>)</em></dt>
<dd><p>Return user input from a multi-textfield dialog box in a cell array of
strings, or an empty cell array if the dialog is closed by the Cancel
button.
</p>
<p>Inputs:
</p>
<dl compact="compact">
<dt><var>prompt</var></dt>
<dd><p>A cell array with strings labeling each text field.  This input is required.
</p>
</dd>
<dt><var>title</var></dt>
<dd><p>String to use for the caption of the dialog.  The default is
<code>&quot;Input Dialog&quot;</code>.
</p>
</dd>
<dt><var>rowscols</var></dt>
<dd><p>Specifies the size of the text fields and can take three forms:
</p>
<ol>
<li> a scalar value which defines the number of rows used for each text
field.

</li><li> a vector which defines the individual number of rows used for each
text field.

</li><li> a matrix which defines the individual number of rows and columns used
for each text field.  In the matrix each row describes a single text field.
The first column specifies the number of input rows to use and the second
column specifies the text field width.
</li></ol>

</dd>
<dt><var>defaults</var></dt>
<dd><p>A list of default values to place in each text field.  It must be a cell
array of strings with the same size as <var>prompt</var>.
</p>
</dd>
<dt><var>options</var></dt>
<dd><p>Not supported, only for <small>MATLAB</small> compatibility.
</p></dd>
</dl>

<p>Example:
</p>
<div class="example">
<pre class="example">prompt = {&quot;Width&quot;, &quot;Height&quot;, &quot;Depth&quot;};
defaults = {&quot;1.10&quot;, &quot;2.20&quot;, &quot;3.30&quot;};
rowscols = [1,10; 2,20; 3,30];
dims = inputdlg (prompt, &quot;Enter Box Dimensions&quot;, ...
                 rowscols, defaults);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFhelpdlg">helpdlg</a>, <a href="#XREFlistdlg">listdlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFquestdlg">questdlg</a>, <a href="#XREFwarndlg">warndlg</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-list-dialog"></a>
<a name="XREFlistdlg"></a><dl>
<dt><a name="index-listdlg"></a><em>[<var>sel</var>, <var>ok</var>] =</em> <strong>listdlg</strong> <em>(<var>key</var>, <var>value</var>, &hellip;)</em></dt>
<dd><p>Return user inputs from a list dialog box in a vector of selection indices
(<var>sel</var>) and a flag indicating how the user closed the dialog box
(<var>ok</var>).
</p>
<p>The indices in <var>sel</var> are 1-based.
</p>
<p>The value of <var>ok</var> is 1 if the user closed the box with the OK button,
otherwise it is 0 and <var>sel</var> is empty.
</p>
<p>Input arguments are specified in form of <var>key</var>, <var>value</var> pairs.
The <code>&quot;ListString&quot;</code> argument pair <strong>must</strong> be specified.
</p>
<p>Valid <var>key</var> and <var>value</var> pairs are:
</p>
<dl compact="compact">
<dt><code>&quot;ListString&quot;</code></dt>
<dd><p>a cell array of strings specifying the items to list in the dialog.
</p>
</dd>
<dt><code>&quot;SelectionMode&quot;</code></dt>
<dd><p>can be either <code>&quot;Single&quot;</code> (only one item may be selected at a time) or
<code>&quot;Multiple&quot;</code> (default).
</p>
</dd>
<dt><code>&quot;ListSize&quot;</code></dt>
<dd><p>a two-element vector <code>[<var>width</var>, <var>height</var>]</code> specifying the size
of the list field in pixels.  The default is [160, 300].
</p>
</dd>
<dt><code>&quot;InitialValue&quot;</code></dt>
<dd><p>a vector containing 1-based indices of elements which will be pre-selected
when the list dialog is first displayed.
The default is 1 (first item).
</p>
</dd>
<dt><code>&quot;Name&quot;</code></dt>
<dd><p>a string to be used as the dialog caption.  Default is &quot;&quot;.
</p>
</dd>
<dt><code>&quot;PromptString&quot;</code></dt>
<dd><p>a cell array of strings to be displayed above the list of items.
Default is {}.
</p>
</dd>
<dt><code>&quot;OKString&quot;</code></dt>
<dd><p>a string used to label the OK button.  Default is <code>&quot;OK&quot;</code>.
</p>
</dd>
<dt><code>&quot;CancelString&quot;</code></dt>
<dd><p>a string used to label the Cancel button.  Default is <code>&quot;Cancel&quot;</code>.
</p></dd>
</dl>

<p>Example:
</p>
<div class="example">
<pre class="example">my_options = {&quot;An item&quot;, &quot;another&quot;, &quot;yet another&quot;};
[sel, ok] = listdlg (&quot;ListString&quot;, my_options,
                     &quot;SelectionMode&quot;, &quot;Multiple&quot;);
if (ok == 1)
  disp (&quot;You selected:&quot;);
  for i = 1:numel (sel)
    disp (sprintf (&quot;\t%s&quot;, my_options{sel(i)}));
  endfor
else
  disp (&quot;You cancelled.&quot;);
endif
</pre></div>


<p><strong>See also:</strong> <a href="Terminal-Input.html#XREFmenu">menu</a>, <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFhelpdlg">helpdlg</a>, <a href="#XREFinputdlg">inputdlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFquestdlg">questdlg</a>, <a href="#XREFwarndlg">warndlg</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-message-dialog"></a>
<a name="XREFmsgbox"></a><dl>
<dt><a name="index-msgbox"></a><em><var>h</var> =</em> <strong>msgbox</strong> <em>(<var>msg</var>)</em></dt>
<dt><a name="index-msgbox-1"></a><em><var>h</var> =</em> <strong>msgbox</strong> <em>(<var>msg</var>, <var>title</var>)</em></dt>
<dt><a name="index-msgbox-2"></a><em><var>h</var> =</em> <strong>msgbox</strong> <em>(<var>msg</var>, <var>title</var>, <var>icon</var>)</em></dt>
<dt><a name="index-msgbox-3"></a><em><var>h</var> =</em> <strong>msgbox</strong> <em>(<var>msg</var>, <var>title</var>, &quot;custom&quot;, <var>cdata</var>)</em></dt>
<dt><a name="index-msgbox-4"></a><em><var>h</var> =</em> <strong>msgbox</strong> <em>(<var>msg</var>, <var>title</var>, &quot;custom&quot;, <var>cdata</var>, <var>colormap</var>)</em></dt>
<dt><a name="index-msgbox-5"></a><em><var>h</var> =</em> <strong>msgbox</strong> <em>(&hellip;, <var>opt</var>)</em></dt>
<dd><p>Display <var>msg</var> using a message dialog box.
</p>
<p>The message may have multiple lines separated by newline characters (&quot;\n&quot;),
or it may be a cellstr array with one element for each line.
</p>
<p>The optional input <var>title</var> (character string) can be used to decorate
the dialog caption.
</p>
<p>The optional argument <var>icon</var> selects a dialog icon.
It can be one of <code>&quot;none&quot;</code> (default), <code>&quot;error&quot;</code>, <code>&quot;help&quot;</code>,
<code>&quot;warn&quot;</code>, or <code>&quot;custom&quot;</code>.  The latter must be followed by an
image array <var>cdata</var>, and for indexed images the associated colormap.
</p>
<p>The final optional argument <var>opt</var> controls the behavior of the dialog.
If <var>opt</var> is a string, it may be one of
</p>
<dl compact="compact">
<dt><code>&quot;non-modal&quot;</code> (default)</dt>
<dd><p>The dialog is normal.
</p>
</dd>
<dt><code>&quot;modal&quot;</code></dt>
<dd><p>The dialog is displayed <code>&quot;modal&quot;</code> which means it prevents users from
interacting with any other GUI element until the dialog has been closed.
</p>
</dd>
<dt><code>&quot;replace&quot;</code></dt>
<dd><p>If any dialogs already exist with the same title, the most recent is reused
and all others are closed.  The resulting dialog is set <code>&quot;non-modal&quot;</code>.
</p></dd>
</dl>

<p>If <var>opt</var> is a structure, it must contain fields <code>&quot;WindowStyle&quot;</code>
and <code>&quot;Interpreter&quot;</code>:
</p>
<dl compact="compact">
<dt><code>&quot;WindowStyle&quot;</code></dt>
<dd><p>The value must be <code>&quot;non-modal&quot;</code>, <code>&quot;modal&quot;</code>, or
<code>&quot;replace&quot;</code>.  See above.
</p>
</dd>
<dt><code>&quot;Interpreter&quot;</code></dt>
<dd><p>Controls the <code>&quot;interpreter&quot;</code> property of the text object used for
displaying the message.  The value must be <code>&quot;tex&quot;</code> (default),
<code>&quot;none&quot;</code>, or <code>&quot;latex&quot;</code>.
</p></dd>
</dl>

<p>The return value <var>h</var> is a handle to the figure object used for building
the dialog.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">msgbox (&quot;Some message for the user.&quot;);
msgbox (&quot;Some message\nwith two lines.&quot;);
msgbox ({&quot;Some message&quot;, &quot;with two lines.&quot;});
msgbox (&quot;Some message for the user.&quot;, &quot;Fancy caption&quot;);

## A message dialog box with error icon
msgbox (&quot;Some message for the user.&quot;, &quot;Fancy caption&quot;, &quot;error&quot;);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFhelpdlg">helpdlg</a>, <a href="#XREFinputdlg">inputdlg</a>, <a href="#XREFlistdlg">listdlg</a>, <a href="#XREFquestdlg">questdlg</a>, <a href="#XREFwarndlg">warndlg</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-question-dialog"></a>
<a name="XREFquestdlg"></a><dl>
<dt><a name="index-questdlg"></a><em><var>btn</var> =</em> <strong>questdlg</strong> <em>(<var>msg</var>)</em></dt>
<dt><a name="index-questdlg-1"></a><em><var>btn</var> =</em> <strong>questdlg</strong> <em>(<var>msg</var>, <var>title</var>)</em></dt>
<dt><a name="index-questdlg-2"></a><em><var>btn</var> =</em> <strong>questdlg</strong> <em>(<var>msg</var>, <var>title</var>, <var>default</var>)</em></dt>
<dt><a name="index-questdlg-3"></a><em><var>btn</var> =</em> <strong>questdlg</strong> <em>(<var>msg</var>, <var>title</var>, <var>btn1</var>, <var>btn2</var>, <var>default</var>)</em></dt>
<dt><a name="index-questdlg-4"></a><em><var>btn</var> =</em> <strong>questdlg</strong> <em>(<var>msg</var>, <var>title</var>, <var>btn1</var>, <var>btn2</var>, <var>btn3</var>, <var>default</var>)</em></dt>
<dd><p>Display <var>msg</var> using a question dialog box and return the caption of
the activated button.
</p>
<p>The message may have multiple lines separated by newline characters (&quot;\n&quot;),
or it may be a cellstr array with one element for each line.
</p>
<p>The optional <var>title</var> (character string) can be used to specify the
dialog caption.  It defaults to <code>&quot;Question Dialog&quot;</code>.
</p>
<p>The dialog may contain two or three buttons which will all close the dialog.
</p>
<p>The string <var>default</var> identifies the default button, which is activated
by pressing the <tt class="key">ENTER</tt> key.  It must match one of the strings given
in <var>btn1</var>, <var>btn2</var>, or <var>btn3</var>.
</p>
<p>If only <var>msg</var> and <var>title</var> are specified, three buttons with the
default captions <code>&quot;Yes&quot;</code>, <code>&quot;No&quot;</code>, and <code>&quot;Cancel&quot;</code> are used.
</p>
<p>If only two button captions, <var>btn1</var> and <var>btn2</var>, are specified the
dialog will have only these two buttons.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">btn = questdlg (&quot;Close Octave?&quot;, &quot;Some fancy title&quot;, ...
                &quot;Yes&quot;, &quot;No&quot;, &quot;No&quot;);
if (strcmp (btn, &quot;Yes&quot;))
  exit ();
endif
</pre></div>


<p><strong>See also:</strong> <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFhelpdlg">helpdlg</a>, <a href="#XREFinputdlg">inputdlg</a>, <a href="#XREFlistdlg">listdlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFwarndlg">warndlg</a>.
</p></dd></dl>


<a name="index-dialog_002c-displaying-a-warning-dialog"></a>
<a name="XREFwarndlg"></a><dl>
<dt><a name="index-warndlg"></a><em></em> <strong>warndlg</strong> <em>()</em></dt>
<dt><a name="index-warndlg-1"></a><em></em> <strong>warndlg</strong> <em>(<var>msg</var>)</em></dt>
<dt><a name="index-warndlg-2"></a><em></em> <strong>warndlg</strong> <em>(<var>msg</var>, <var>title</var>)</em></dt>
<dt><a name="index-warndlg-3"></a><em></em> <strong>warndlg</strong> <em>(<var>msg</var>, <var>title</var>, <var>opt</var>)</em></dt>
<dt><a name="index-warndlg-4"></a><em><var>h</var> =</em> <strong>warndlg</strong> <em>(&hellip;)</em></dt>
<dd><p>Display a warning dialog box with warning message <var>msg</var> and caption
<var>title</var>.
</p>
<p>The default warning message is
<code>&quot;This is the default warning string.&quot;</code> and the default caption is
<code>&quot;Warning Dialog&quot;</code>.
</p>
<p>The warning message may have multiple lines separated by newline characters
(&quot;\n&quot;), or it may be a cellstr array with one element for each line.
</p>
<p>The third optional argument <var>opt</var> controls the behavior of the dialog.
See <code>msgbox</code> for details.
</p>
<p>The return value <var>h</var> is a handle to the figure object used for
building the dialog.
</p>
<p>Examples:
</p>
<div class="example">
<pre class="example">warndlg (&quot;Some warning text for the user.&quot;);
warndlg (&quot;Some warning text\nwith two lines.&quot;);
warndlg ({&quot;Some warning text&quot;, &quot;with two lines.&quot;});
warndlg (&quot;Some warning text for the user.&quot;, &quot;Fancy caption&quot;);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFhelpdlg">helpdlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFinputdlg">inputdlg</a>, <a href="#XREFlistdlg">listdlg</a>, <a href="#XREFquestdlg">questdlg</a>.
</p></dd></dl>


<p>For creating new dialog types, there is a dialog function.
</p>
<a name="index-dialog_002c-displaying-a-modal-dialog"></a>
<a name="XREFdialog"></a><dl>
<dt><a name="index-dialog"></a><em><var>h</var> =</em> <strong>dialog</strong> <em>()</em></dt>
<dt><a name="index-dialog-1"></a><em><var>h</var> =</em> <strong>dialog</strong> <em>(&quot;<var>property</var>&quot;, <var>value</var>, &hellip;)</em></dt>
<dd>
<p>Create an empty modal dialog window to which other uicontrols can be added.
</p>
<p>The dialog box is a figure object with properties as recommended for a
dialog box.
</p>
<p>The default properties differing from a figure are:
</p>
<dl compact="compact">
<dt>buttondownfcn</dt>
<dd><p><code>if isempty (allchild(gcbf)), close (gcbf), endif</code>
</p>
</dd>
<dt>colormap</dt>
<dd><p>[]
</p>
</dd>
<dt>color</dt>
<dd><p>defaultuicontrolbackgroundcolor
</p>
</dd>
<dt>dockcontrols</dt>
<dd><p>off
</p>
</dd>
<dt>handlevisibility</dt>
<dd><p>callback
</p>
</dd>
<dt>integerhandle</dt>
<dd><p>off
</p>
</dd>
<dt>inverthardcopy</dt>
<dd><p>off
</p>
</dd>
<dt>menubar</dt>
<dd><p>none
</p>
</dd>
<dt>numbertitle</dt>
<dd><p>off
</p>
</dd>
<dt>paperpositionmode</dt>
<dd><p>auto
</p>
</dd>
<dt>resize</dt>
<dd><p>off
</p>
</dd>
<dt>windowstyle</dt>
<dd><p>modal
</p>
</dd>
</dl>


<p>Multiple property-value pairs may be specified for the dialog object, but
they must appear in pairs.
</p>
<p>The return value <var>h</var> is a graphics handle to the created figure.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">## create an empty dialog window titled &quot;Dialog Example&quot;
h = dialog (&quot;name&quot;, &quot;Dialog Example&quot;);

## create a button (default style)
b = uicontrol (h, &quot;string&quot;, &quot;OK&quot;,
                  &quot;position&quot;, [10 10 150 40],
                  &quot;callback&quot;, &quot;delete (gcf)&quot;);

## wait for dialog to resume or close
uiwait (h);
</pre></div>


<p><strong>See also:</strong> <a href="#XREFerrordlg">errordlg</a>, <a href="#XREFmsgbox">msgbox</a>, <a href="#XREFquestdlg">questdlg</a>, <a href="#XREFwarndlg">warndlg</a>, <a href="Multiple-Plot-Windows.html#XREFfigure">figure</a>, <a href="GUI-Utility-Functions.html#XREFuiwait">uiwait</a>.
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="Progress-Bar.html#Progress-Bar" accesskey="n" rel="next">Progress Bar</a>, Up: <a href="GUI-Development.html#GUI-Development" accesskey="u" rel="up">GUI Development</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>