File: GUI-Utility-Functions.html

package info (click to toggle)
octave 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 124,192 kB
  • sloc: cpp: 322,665; ansic: 68,088; fortran: 20,980; objc: 8,121; sh: 7,719; yacc: 4,266; lex: 4,123; perl: 1,530; java: 1,366; awk: 1,257; makefile: 424; xml: 147
file content (276 lines) | stat: -rw-r--r-- 13,172 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GUI Utility Functions (GNU Octave (version 6.2.0))</title>

<meta name="description" content="GUI Utility Functions (GNU Octave (version 6.2.0))">
<meta name="keywords" content="GUI Utility Functions (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="GUI-Development.html" rel="up" title="GUI Development">
<link href="User_002dDefined-Preferences.html" rel="next" title="User-Defined Preferences">
<link href="UI-Elements.html" rel="prev" title="UI Elements">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {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}
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">
<span id="GUI-Utility-Functions"></span><div class="header">
<p>
Next: <a href="User_002dDefined-Preferences.html" accesskey="n" rel="next">User-Defined Preferences</a>, Previous: <a href="UI-Elements.html" accesskey="p" rel="prev">UI Elements</a>, Up: <a href="GUI-Development.html" 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" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="GUI-Utility-Functions-1"></span><h3 class="section">35.4 GUI Utility Functions</h3>

<p>These functions do not implement a GUI element but are useful when developing
programs that do.  The functions <code>uiwait</code>, <code>uiresume</code>, and
<code>waitfor</code> are only available with the <code>qt</code> or <code>fltk</code> toolkits.
</p>
<span id="XREFguidata"></span><dl>
<dt id="index-guidata">: <em><var>data</var> =</em> <strong>guidata</strong> <em>(<var>h</var>)</em></dt>
<dt id="index-guidata-1">: <em></em> <strong>guidata</strong> <em>(<var>h</var>, <var>data</var>)</em></dt>
<dd><p>Query or set user-custom GUI data.
</p>
<p>The GUI data is stored in the figure handle <var>h</var>.  If <var>h</var> is not a
figure handle then it&rsquo;s parent figure will be used for storage.
</p>
<p><var>data</var> must be a single object which means it is usually preferable
for it to be a data container such as a cell array or struct so that
additional data items can be added easily.
</p>

<p><strong>See also:</strong> <a href="Application_002ddefined-Data.html#XREFgetappdata">getappdata</a>, <a href="Application_002ddefined-Data.html#XREFsetappdata">setappdata</a>, <a href="Graphics-Objects.html#XREFget">get</a>, <a href="Graphics-Objects.html#XREFset">set</a>, <a href="User_002dDefined-Preferences.html#XREFgetpref">getpref</a>, <a href="User_002dDefined-Preferences.html#XREFsetpref">setpref</a>.
</p></dd></dl>


<span id="XREFguihandles"></span><dl>
<dt id="index-guihandles">: <em><var>hdata</var> =</em> <strong>guihandles</strong> <em>(<var>h</var>)</em></dt>
<dt id="index-guihandles-1">: <em><var>hdata</var> =</em> <strong>guihandles</strong></dt>
<dd><p>Return a structure of object handles for the figure associated with
handle <var>h</var>.
</p>
<p>If no handle is specified the current figure returned by <code>gcf</code> is used.
</p>
<p>The fieldname for each entry of <var>hdata</var> is taken from the <code>&quot;tag&quot;</code>
property of the graphic object.  If the tag is empty then the handle is not
returned.  If there are multiple graphic objects with the same tag then
the entry in <var>hdata</var> will be a vector of handles.  <code>guihandles</code>
includes all possible handles, including those for
which <code>&quot;HandleVisibility&quot;</code> is <code>&quot;off&quot;</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFguidata">guidata</a>, <a href="Searching-Properties.html#XREFfindobj">findobj</a>, <a href="Searching-Properties.html#XREFfindall">findall</a>, <a href="Graphics-Objects.html#XREFallchild">allchild</a>.
</p></dd></dl>


<span id="XREFhave_005fwindow_005fsystem"></span><dl>
<dt id="index-have_005fwindow_005fsystem">: <em></em> <strong>have_window_system</strong> <em>()</em></dt>
<dd><p>Return true if a window system is available (X11, Windows, or Apple OS X)
and false otherwise.
</p>
<p><strong>See also:</strong> <a href="#XREFisguirunning">isguirunning</a>.
</p></dd></dl>


<span id="XREFisguirunning"></span><dl>
<dt id="index-isguirunning">: <em></em> <strong>isguirunning</strong> <em>()</em></dt>
<dd><p>Return true if Octave is running in GUI mode and false otherwise.
</p>
<p><strong>See also:</strong> <a href="#XREFhave_005fwindow_005fsystem">have_window_system</a>.
</p></dd></dl>


<span id="XREFmovegui"></span><dl>
<dt id="index-movegui">: <em></em> <strong>movegui</strong></dt>
<dt id="index-movegui-1">: <em></em> <strong>movegui</strong> <em>(<var>h</var>)</em></dt>
<dt id="index-movegui-2">: <em></em> <strong>movegui</strong> <em>(<var>pos</var>)</em></dt>
<dt id="index-movegui-3">: <em></em> <strong>movegui</strong> <em>(<var>h</var>, <var>pos</var>)</em></dt>
<dt id="index-movegui-4">: <em></em> <strong>movegui</strong> <em>(<var>h</var>, <var>event</var>)</em></dt>
<dt id="index-movegui-5">: <em></em> <strong>movegui</strong> <em>(<var>h</var>, <var>event</var>, <var>pos</var>)</em></dt>
<dd><p>Move a figure specified by figure handle <var>h</var> to a position on the screen
defined by <var>pos</var>.
</p>
<p><var>h</var> is a figure handle, or a handle to a graphics object.  In the latter
case, its parent figure will be used.  If unspecified, <var>h</var> will be
set to the handle of the relevant figure if a callback is being executed
(<code>gcbf</code>), otherwise it will be set to the handle of the current figure
(<code>gcf</code>).
</p>
<p><var>pos</var> is either a two-value numeric vector or a string.  If <var>pos</var> is
numeric then it must be of the form <code>[h, v]</code> specifying the horizontal
and vertical offsets of the figure with respect to the screen.  A positive
value indicates the offset between the left (or bottom for the vertical
component) of the screen, and the left (or bottom) of the figure.  A
negative value indicates the offset between the right (or top) of the screen
and the right (or top) of the figure.
</p>
<p>Possible values for <var>pos</var> as a string are
</p>
<dl compact="compact">
<dt><code>north</code></dt>
<dd><p>Top center of the screen.
</p>
</dd>
<dt><code>south</code></dt>
<dd><p>Bottom center of the screen.
</p>
</dd>
<dt><code>east</code></dt>
<dd><p>Right center of the screen.
</p>
</dd>
<dt><code>west</code></dt>
<dd><p>Left center of the screen.
</p>
</dd>
<dt><code>northeast</code></dt>
<dd><p>Top right of the screen.
</p>
</dd>
<dt><code>northwest</code></dt>
<dd><p>Top left of the screen.
</p>
</dd>
<dt><code>southeast</code></dt>
<dd><p>Bottom right of the screen.
</p>
</dd>
<dt><code>southwest</code></dt>
<dd><p>Bottom left of the screen.
</p>
</dd>
<dt><code>center</code></dt>
<dd><p>Center of the screen.
</p>
</dd>
<dt><code>onscreen (default)</code></dt>
<dd><p>The figure will be minimally moved to be entirely visible on the screen,
with a 30 pixel extra padding from the sides of the screen.  This is the
default value if none is provided.
</p></dd>
</dl>

<p><var>event</var> contains event data that will be ignored.  This construct
facilitates a call to movegui from a callback.
</p>
</dd></dl>


<span id="XREFopenvar"></span><dl>
<dt id="index-openvar">: <em></em> <strong>openvar</strong> <em>(<var>name</var>)</em></dt>
<dd><p>Open the variable <var>name</var> in the graphical Variable Editor.
</p></dd></dl>


<span id="XREFuiwait"></span><dl>
<dt id="index-uiwait">: <em></em> <strong>uiwait</strong></dt>
<dt id="index-uiwait-1">: <em></em> <strong>uiwait</strong> <em>(<var>h</var>)</em></dt>
<dt id="index-uiwait-2">: <em></em> <strong>uiwait</strong> <em>(<var>h</var>, <var>timeout</var>)</em></dt>
<dd><p>Suspend program execution until the figure with handle <var>h</var> is deleted
or <code>uiresume</code> is called.
</p>
<p>When no figure handle is specified this function uses the current figure.
If the figure handle is invalid or there is no current figure, this
functions returns immediately.
</p>
<p>When specified, <var>timeout</var> defines the number of seconds to wait
for the figure deletion or the <code>uiresume</code> call.  The timeout value
must be at least 1.  If a smaller value is specified, a warning is issued
and a timeout value of 1 is used instead.  If a non-integer value is
specified, it is truncated towards 0.  If <var>timeout</var> is not specified,
the program execution is suspended indefinitely.
</p>
<p><strong>See also:</strong> <a href="#XREFuiresume">uiresume</a>, <a href="#XREFwaitfor">waitfor</a>.
</p></dd></dl>


<span id="XREFuiresume"></span><dl>
<dt id="index-uiresume">: <em></em> <strong>uiresume</strong> <em>(<var>h</var>)</em></dt>
<dd><p>Resume program execution suspended with <code>uiwait</code>.
</p>
<p>The handle <var>h</var> must be the same as the on specified in <code>uiwait</code>.
If the handle is invalid or there is no <code>uiwait</code> call pending for the
figure with handle <var>h</var>, this function does nothing.
</p>
<p><strong>See also:</strong> <a href="#XREFuiwait">uiwait</a>.
</p></dd></dl>


<span id="XREFwaitfor"></span><dl>
<dt id="index-waitfor">: <em></em> <strong>waitfor</strong> <em>(<var>h</var>)</em></dt>
<dt id="index-waitfor-1">: <em></em> <strong>waitfor</strong> <em>(<var>h</var>, <var>prop</var>)</em></dt>
<dt id="index-waitfor-2">: <em></em> <strong>waitfor</strong> <em>(<var>h</var>, <var>prop</var>, <var>value</var>)</em></dt>
<dt id="index-waitfor-3">: <em></em> <strong>waitfor</strong> <em>(&hellip;, &quot;timeout&quot;, <var>timeout</var>)</em></dt>
<dd><p>Suspend the execution of the current program until a condition is
satisfied on the graphics handle <var>h</var>.
</p>
<p>While the program is suspended graphics events are still processed normally,
allowing callbacks to modify the state of graphics objects.  This function
is reentrant and can be called from a callback, while another <code>waitfor</code>
call is pending at the top-level.
</p>
<p>In the first form, program execution is suspended until the graphics object
<var>h</var> is destroyed.  If the graphics handle is invalid or if <var>h</var> is
the root graphics handle and no property <var>prop</var> was provided, the function
returns immediately.
</p>
<p>In the second form, execution is suspended until the graphics object is
destroyed or the property named <var>prop</var> is modified.  If the graphics
handle is invalid or the property does not exist, the function returns
immediately.
</p>
<p>In the third form, execution is suspended until the graphics object is
destroyed or the property named <var>prop</var> is set to <var>value</var>.  The
function <code>isequal</code> is used to compare property values.  If the graphics
handle is invalid, the property does not exist or the property is already
set to <var>value</var>, the function returns immediately.
</p>
<p>An optional timeout can be specified using the property <code>&quot;timeout&quot;</code>.
This timeout value is the number of seconds to wait for the condition to be
true.  <var>timeout</var> must be at least 1.  If a smaller value is specified, a
warning is issued and a value of 1 is used instead.  If the timeout value is
not an integer, it is truncated towards 0.
</p>
<p>To define a condition on a property named <code>&quot;timeout&quot;</code>, use the string
<code>'\timeout'</code> instead.
</p>
<p>In all cases, typing CTRL-C stops program execution immediately.
</p>
<p><strong>See also:</strong> <a href="Interacting-with-Plots.html#XREFwaitforbuttonpress">waitforbuttonpress</a>, <a href="Comparison-Ops.html#XREFisequal">isequal</a>.
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="User_002dDefined-Preferences.html" accesskey="n" rel="next">User-Defined Preferences</a>, Previous: <a href="UI-Elements.html" accesskey="p" rel="prev">UI Elements</a>, Up: <a href="GUI-Development.html" 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" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>