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 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkNativeDialog: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="AbstractObjects.html" title="Abstract Base Classes">
<link rel="prev" href="GtkIMContext.html" title="GtkIMContext">
<link rel="next" href="PlugSocket.html" title="Cross-process Embedding">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#gtk3-GtkNativeDialog.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="AbstractObjects.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkIMContext.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="PlugSocket.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk3-GtkNativeDialog"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkNativeDialog.top_of_page"></a>GtkNativeDialog</span></h2>
<p>GtkNativeDialog — Integrate with native dialogs</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-show" title="gtk_native_dialog_show ()">gtk_native_dialog_show</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-hide" title="gtk_native_dialog_hide ()">gtk_native_dialog_hide</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-destroy" title="gtk_native_dialog_destroy ()">gtk_native_dialog_destroy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-get-visible" title="gtk_native_dialog_get_visible ()">gtk_native_dialog_get_visible</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-set-modal" title="gtk_native_dialog_set_modal ()">gtk_native_dialog_set_modal</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-get-modal" title="gtk_native_dialog_get_modal ()">gtk_native_dialog_get_modal</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-set-title" title="gtk_native_dialog_set_title ()">gtk_native_dialog_set_title</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-get-title" title="gtk_native_dialog_get_title ()">gtk_native_dialog_get_title</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-set-transient-for" title="gtk_native_dialog_set_transient_for ()">gtk_native_dialog_set_transient_for</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWindow.html" title="GtkWindow"><span class="returnvalue">GtkWindow</span></a> *
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-get-transient-for" title="gtk_native_dialog_get_transient_for ()">gtk_native_dialog_get_transient_for</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-run" title="gtk_native_dialog_run ()">gtk_native_dialog_run</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="gtk3-GtkNativeDialog.html#GTK-TYPE-NATIVE-DIALOG:CAPS" title="GTK_TYPE_NATIVE_DIALOG">GTK_TYPE_NATIVE_DIALOG</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gtk3-GtkNativeDialog.html#GtkNativeDialogClass" title="struct GtkNativeDialogClass">GtkNativeDialogClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <gtk/gtk.h>
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.description"></a><h2>Description</h2>
<p>Native dialogs are platform dialogs that don't use <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a> or
<a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a>. They are used in order to integrate better with a
platform, by looking the same as other native applications and
supporting platform specific features.</p>
<p>The <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a> functions cannot be used on such objects, but we
need a similar API in order to drive them. The <span class="type">GtkNativeDialog</span>
object is an API that allows you to do this. It allows you to set
various common properties on the dialog, as well as show and hide
it and get a <span class="type">“response”</span> signal when the user finished
with the dialog.</p>
<p>There is also a <a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-run" title="gtk_native_dialog_run ()"><code class="function">gtk_native_dialog_run()</code></a> helper that makes it easy
to run any native dialog in a modal way with a recursive mainloop,
similar to <a class="link" href="GtkDialog.html#gtk-dialog-run" title="gtk_dialog_run ()"><code class="function">gtk_dialog_run()</code></a>.</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-native-dialog-show"></a><h3>gtk_native_dialog_show ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_native_dialog_show (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Shows the dialog on the display, allowing the user to interact with
it. When the user accepts the state of the dialog the dialog will
be automatically hidden and the <span class="type">“response”</span> signal
will be emitted.</p>
<p>Multiple calls while the dialog is visible will be ignored.</p>
<div class="refsect3">
<a name="gtk-native-dialog-show.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-hide"></a><h3>gtk_native_dialog_hide ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_native_dialog_hide (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Hides the dialog if it is visilbe, aborting any interaction. Once this
is called the <span class="type">“response”</span> signal will not be emitted
until after the next call to <a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-show" title="gtk_native_dialog_show ()"><code class="function">gtk_native_dialog_show()</code></a>.</p>
<p>If the dialog is not visible this does nothing.</p>
<div class="refsect3">
<a name="gtk-native-dialog-hide.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-destroy"></a><h3>gtk_native_dialog_destroy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_native_dialog_destroy (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Destroys a dialog.</p>
<p>When a dialog is destroyed, it will break any references it holds
to other objects. If it is visible it will be hidden and any underlying
window system resources will be destroyed.</p>
<p>Note that this does not release any reference to the object (as opposed to
destroying a GtkWindow) because there is no reference from the windowing
system to the <span class="type">GtkNativeDialog</span>.</p>
<div class="refsect3">
<a name="gtk-native-dialog-destroy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-get-visible"></a><h3>gtk_native_dialog_get_visible ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_native_dialog_get_visible (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Determines whether the dialog is visible.</p>
<div class="refsect3">
<a name="gtk-native-dialog-get-visible.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-native-dialog-get-visible.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the dialog is visible</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-set-modal"></a><h3>gtk_native_dialog_set_modal ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_native_dialog_set_modal (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>,
<em class="parameter"><code><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> modal</code></em>);</pre>
<p>Sets a dialog modal or non-modal. Modal dialogs prevent interaction
with other windows in the same application. To keep modal dialogs
on top of main application windows, use
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-set-transient-for" title="gtk_native_dialog_set_transient_for ()"><code class="function">gtk_native_dialog_set_transient_for()</code></a> to make the dialog transient for the
parent; most <a class="link" href="gtk-x11.html#gtk-X11-arch" title="Understanding the X11 architecture">window managers</a>
will then disallow lowering the dialog below the parent.</p>
<div class="refsect3">
<a name="gtk-native-dialog-set-modal.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>modal</p></td>
<td class="parameter_description"><p>whether the window is modal</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-get-modal"></a><h3>gtk_native_dialog_get_modal ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_native_dialog_get_modal (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Returns whether the dialog is modal. See <a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-set-modal" title="gtk_native_dialog_set_modal ()"><code class="function">gtk_native_dialog_set_modal()</code></a>.</p>
<div class="refsect3">
<a name="gtk-native-dialog-get-modal.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-native-dialog-get-modal.returns"></a><h4>Returns</h4>
<p> <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the dialog is set to be modal</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-set-title"></a><h3>gtk_native_dialog_set_title ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_native_dialog_set_title (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *title</code></em>);</pre>
<p>Sets the title of the <span class="type">GtkNativeDialog</span>.</p>
<div class="refsect3">
<a name="gtk-native-dialog-set-title.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>title</p></td>
<td class="parameter_description"><p>title of the dialog</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-get-title"></a><h3>gtk_native_dialog_get_title ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
gtk_native_dialog_get_title (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Gets the title of the <span class="type">GtkNativeDialog</span>.</p>
<div class="refsect3">
<a name="gtk-native-dialog-get-title.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-native-dialog-get-title.returns"></a><h4>Returns</h4>
<p> the title of the dialog, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none has
been set explicitly. The returned string is owned by the widget
and must not be modified or freed. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-set-transient-for"></a><h3>gtk_native_dialog_set_transient_for ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_native_dialog_set_transient_for (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>,
<em class="parameter"><code><a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a> *parent</code></em>);</pre>
<p>Dialog windows should be set transient for the main application
window they were spawned from. This allows
<a class="link" href="gtk-x11.html#gtk-X11-arch" title="Understanding the X11 architecture">window managers</a> to e.g. keep the
dialog on top of the main window, or center the dialog over the
main window.</p>
<p>Passing <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for <em class="parameter"><code>parent</code></em>
unsets the current transient window.</p>
<div class="refsect3">
<a name="gtk-native-dialog-set-transient-for.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>parent</p></td>
<td class="parameter_description"><p> parent window, or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-get-transient-for"></a><h3>gtk_native_dialog_get_transient_for ()</h3>
<pre class="programlisting"><a class="link" href="GtkWindow.html" title="GtkWindow"><span class="returnvalue">GtkWindow</span></a> *
gtk_native_dialog_get_transient_for (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Fetches the transient parent for this window. See
<a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-set-transient-for" title="gtk_native_dialog_set_transient_for ()"><code class="function">gtk_native_dialog_set_transient_for()</code></a>.</p>
<div class="refsect3">
<a name="gtk-native-dialog-get-transient-for.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-native-dialog-get-transient-for.returns"></a><h4>Returns</h4>
<p> the transient parent for this window,
or <a href="https://developer.gnome.org/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no transient parent has been set. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-native-dialog-run"></a><h3>gtk_native_dialog_run ()</h3>
<pre class="programlisting"><a href="https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gtk_native_dialog_run (<em class="parameter"><code><span class="type">GtkNativeDialog</span> *self</code></em>);</pre>
<p>Blocks in a recursive main loop until <em class="parameter"><code>self</code></em>
emits the
<span class="type">“response”</span> signal. It then returns the response ID
from the ::response signal emission.</p>
<p>Before entering the recursive main loop, <a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-run" title="gtk_native_dialog_run ()"><code class="function">gtk_native_dialog_run()</code></a>
calls <a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-show" title="gtk_native_dialog_show ()"><code class="function">gtk_native_dialog_show()</code></a> on the dialog for you.</p>
<p>After <a class="link" href="gtk3-GtkNativeDialog.html#gtk-native-dialog-run" title="gtk_native_dialog_run ()"><code class="function">gtk_native_dialog_run()</code></a> returns, then dialog will be hidden.</p>
<p>Typical usage of this function might be:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11</pre></td>
<td class="listing_code"><pre class="programlisting">gint result <span class="gtkdoc opt">=</span> <span class="function"><a href="gtk3-GtkNativeDialog.html#gtk-native-dialog-run">gtk_native_dialog_run</a></span> <span class="gtkdoc opt">(</span><span class="function">GTK_NATIVE_DIALOG</span> <span class="gtkdoc opt">(</span>dialog<span class="gtkdoc opt">));</span>
<span class="keyword">switch</span> <span class="gtkdoc opt">(</span>result<span class="gtkdoc opt">)</span>
<span class="gtkdoc opt">{</span>
<span class="keyword">case</span> GTK_RESPONSE_ACCEPT<span class="gtkdoc opt">:</span>
<span class="function">do_application_specific_something</span> <span class="gtkdoc opt">();</span>
<span class="keyword">break</span><span class="gtkdoc opt">;</span>
<span class="keyword">default</span><span class="gtkdoc opt">:</span>
<span class="function">do_nothing_since_dialog_was_cancelled</span> <span class="gtkdoc opt">();</span>
<span class="keyword">break</span><span class="gtkdoc opt">;</span>
<span class="gtkdoc opt">}</span>
<span class="function"><a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span> <span class="gtkdoc opt">(</span>dialog<span class="gtkdoc opt">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>Note that even though the recursive main loop gives the effect of a
modal dialog (it prevents the user from interacting with other
windows in the same window group while the dialog is run), callbacks
such as timeouts, IO channel watches, DND drops, etc, will
be triggered during a <code class="function">gtk_nautilus_dialog_run()</code> call.</p>
<div class="refsect3">
<a name="gtk-native-dialog-run.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <span class="type">GtkNativeDialog</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-native-dialog-run.returns"></a><h4>Returns</h4>
<p> response ID</p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-20.html#api-index-3.20">3.20</a></p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GTK-TYPE-NATIVE-DIALOG:CAPS"></a><h3>GTK_TYPE_NATIVE_DIALOG</h3>
<pre class="programlisting">#define GTK_TYPE_NATIVE_DIALOG (gtk_native_dialog_get_type ())
</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkNativeDialogClass"></a><h3>struct GtkNativeDialogClass</h3>
<pre class="programlisting">struct GtkNativeDialogClass {
GObjectClass parent_class;
void (* response) (GtkNativeDialog *self, gint response_id);
};
</pre>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkNativeDialog.see-also"></a><h2>See Also</h2>
<p><span class="type">GtkFileChooserNative</span>, <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25.1</div>
</body>
</html>
|