gtk3/docs/reference/gtk/html/gtk3-GtkNativeDialog.html
2020-04-10 15:23:16 +01:00

571 lines
27 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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.32.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_proto_type">
<col class="functions_proto_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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gint</span>
</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="other_proto_type">
<col class="other_proto_name">
</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 &lt;gtk/gtk.h&gt;
</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"><span class="returnvalue">gboolean</span>
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> <code class="literal">TRUE</code> 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><span class="type">gboolean</span> 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"><span class="returnvalue">gboolean</span>
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> <code class="literal">TRUE</code> 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 <code class="literal">NULL</code> 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 <code class="literal">NULL</code> 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 <code class="literal">NULL</code>. </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 <code class="literal">NULL</code> 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"><span class="returnvalue">gint</span>
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"><span class="n">gint</span> <span class="n">result</span> <span class="o">=</span> <span class="n">gtk_native_dialog_run</span> <span class="p">(</span><span class="n">GTK_NATIVE_DIALOG</span> <span class="p">(</span><span class="n">dialog</span><span class="p">));</span>
<span class="k">switch</span> <span class="p">(</span><span class="n">result</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">case</span> <span class="nl">GTK_RESPONSE_ACCEPT</span><span class="p">:</span>
<span class="n">do_application_specific_something</span> <span class="p">();</span>
<span class="k">break</span><span class="p">;</span>
<span class="k">default</span><span class="o">:</span>
<span class="n">do_nothing_since_dialog_was_cancelled</span> <span class="p">();</span>
<span class="k">break</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">g_object_unref</span> <span class="p">(</span><span class="n">dialog</span><span class="p">);</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.32.1</div>
</body>
</html>