gtk3/docs/reference/gtk/html/gtk3-GtkFileChooserNative.html
2022-06-01 16:13:05 +01:00

506 lines
33 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>GtkFileChooserNative: 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="SelectorWidgets.html" title="Selector Widgets and Dialogs">
<link rel="prev" href="GtkFileChooserButton.html" title="GtkFileChooserButton">
<link rel="next" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog">
<meta name="generator" content="GTK-Doc V1.33.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-GtkFileChooserNative.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="SelectorWidgets.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkFileChooserButton.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkFileChooserDialog.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk3-GtkFileChooserNative"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkFileChooserNative.top_of_page"></a>GtkFileChooserNative</span></h2>
<p>GtkFileChooserNative — A native file chooser dialog, suitable for “File/Open” or “File/Save” commands</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserNative.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">GtkFileChooserNative</span> *
</td>
<td class="function_name">
<a class="link" href="gtk3-GtkFileChooserNative.html#gtk-file-chooser-native-new" title="gtk_file_chooser_native_new ()">gtk_file_chooser_native_new</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-GtkFileChooserNative.html#gtk-file-chooser-native-get-accept-label" title="gtk_file_chooser_native_get_accept_label ()">gtk_file_chooser_native_get_accept_label</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-GtkFileChooserNative.html#gtk-file-chooser-native-set-accept-label" title="gtk_file_chooser_native_set_accept_label ()">gtk_file_chooser_native_set_accept_label</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-GtkFileChooserNative.html#gtk-file-chooser-native-get-cancel-label" title="gtk_file_chooser_native_get_cancel_label ()">gtk_file_chooser_native_get_cancel_label</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-GtkFileChooserNative.html#gtk-file-chooser-native-set-cancel-label" title="gtk_file_chooser_native_set_cancel_label ()">gtk_file_chooser_native_set_cancel_label</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserNative.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserNative.description"></a><h2>Description</h2>
<p><span class="type">GtkFileChooserNative</span> is an abstraction of a dialog box suitable
for use with “File/Open” or “File/Save as” commands. By default, this
just uses a <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a> to implement the actual dialog.
However, on certain platforms, such as Windows and macOS, the native platform
file chooser is used instead. When the application is running in a
sandboxed environment without direct filesystem access (such as Flatpak),
<span class="type">GtkFileChooserNative</span> may call the proper APIs (portals) to let the user
choose a file and make it available to the application.</p>
<p>While the API of <span class="type">GtkFileChooserNative</span> closely mirrors <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>, the main
difference is that there is no access to any <a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a> or <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> for the dialog.
This is required, as there may not be one in the case of a platform native dialog.
Showing, hiding and running the dialog is handled by the <span class="type">GtkNativeDialog</span> functions.</p>
<div class="refsect3">
<a name="gtkfilechoosernative-typical-usage"></a><h4>Typical usage</h4>
<p>In the simplest of cases, you can the following code to use
<a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a> to select a file for opening:</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
12
13
14
15
16
17
18
19
20
21</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">GtkFileChooserNative</span><span class="w"> </span><span class="o">*</span><span class="n">native</span><span class="p">;</span><span class="w"></span>
<span class="n">GtkFileChooserAction</span><span class="w"> </span><span class="n">action</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">GTK_FILE_CHOOSER_ACTION_OPEN</span><span class="p">;</span><span class="w"></span>
<span class="n">gint</span><span class="w"> </span><span class="n">res</span><span class="p">;</span><span class="w"></span>
<span class="n">native</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">gtk_file_chooser_native_new</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;Open File&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">parent_window</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">action</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s">&quot;_Open&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s">&quot;_Cancel&quot;</span><span class="p">);</span><span class="w"></span>
<span class="n">res</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">gtk_native_dialog_run</span><span class="w"> </span><span class="p">(</span><span class="n">GTK_NATIVE_DIALOG</span><span class="w"> </span><span class="p">(</span><span class="n">native</span><span class="p">));</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">res</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">GTK_RESPONSE_ACCEPT</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">filename</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">GtkFileChooser</span><span class="w"> </span><span class="o">*</span><span class="n">chooser</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">GTK_FILE_CHOOSER</span><span class="w"> </span><span class="p">(</span><span class="n">native</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">filename</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">gtk_file_chooser_get_filename</span><span class="w"> </span><span class="p">(</span><span class="n">chooser</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">open_file</span><span class="w"> </span><span class="p">(</span><span class="n">filename</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">g_free</span><span class="w"> </span><span class="p">(</span><span class="n">filename</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="n">g_object_unref</span><span class="w"> </span><span class="p">(</span><span class="n">native</span><span class="p">);</span><span class="w"></span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>To use a dialog for saving, you can use this:</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
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="n">GtkFileChooserNative</span><span class="w"> </span><span class="o">*</span><span class="n">native</span><span class="p">;</span><span class="w"></span>
<span class="n">GtkFileChooser</span><span class="w"> </span><span class="o">*</span><span class="n">chooser</span><span class="p">;</span><span class="w"></span>
<span class="n">GtkFileChooserAction</span><span class="w"> </span><span class="n">action</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">GTK_FILE_CHOOSER_ACTION_SAVE</span><span class="p">;</span><span class="w"></span>
<span class="n">gint</span><span class="w"> </span><span class="n">res</span><span class="p">;</span><span class="w"></span>
<span class="n">native</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">gtk_file_chooser_native_new</span><span class="w"> </span><span class="p">(</span><span class="s">&quot;Save File&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">parent_window</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">action</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s">&quot;_Save&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="s">&quot;_Cancel&quot;</span><span class="p">);</span><span class="w"></span>
<span class="n">chooser</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">GTK_FILE_CHOOSER</span><span class="w"> </span><span class="p">(</span><span class="n">native</span><span class="p">);</span><span class="w"></span>
<span class="n">gtk_file_chooser_set_do_overwrite_confirmation</span><span class="w"> </span><span class="p">(</span><span class="n">chooser</span><span class="p">,</span><span class="w"> </span><span class="n">TRUE</span><span class="p">);</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">user_edited_a_new_document</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="n">gtk_file_chooser_set_current_name</span><span class="w"> </span><span class="p">(</span><span class="n">chooser</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">_</span><span class="p">(</span><span class="s">&quot;Untitled document&quot;</span><span class="p">));</span><span class="w"></span>
<span class="k">else</span><span class="w"></span>
<span class="w"> </span><span class="n">gtk_file_chooser_set_filename</span><span class="w"> </span><span class="p">(</span><span class="n">chooser</span><span class="p">,</span><span class="w"></span>
<span class="w"> </span><span class="n">existing_filename</span><span class="p">);</span><span class="w"></span>
<span class="n">res</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">gtk_native_dialog_run</span><span class="w"> </span><span class="p">(</span><span class="n">GTK_NATIVE_DIALOG</span><span class="w"> </span><span class="p">(</span><span class="n">native</span><span class="p">));</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">res</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">GTK_RESPONSE_ACCEPT</span><span class="p">)</span><span class="w"></span>
<span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">filename</span><span class="p">;</span><span class="w"></span>
<span class="w"> </span><span class="n">filename</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">gtk_file_chooser_get_filename</span><span class="w"> </span><span class="p">(</span><span class="n">chooser</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">save_to_file</span><span class="w"> </span><span class="p">(</span><span class="n">filename</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="n">g_free</span><span class="w"> </span><span class="p">(</span><span class="n">filename</span><span class="p">);</span><span class="w"></span>
<span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="n">g_object_unref</span><span class="w"> </span><span class="p">(</span><span class="n">native</span><span class="p">);</span><span class="w"></span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>For more information on how to best set up a file dialog, see <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>.</p>
</div>
<div class="refsect3">
<a name="gtkfilechooserdialognative-responses"></a><h4>Response Codes</h4>
<p><span class="type">GtkFileChooserNative</span> inherits from <span class="type">GtkNativeDialog</span>, which means it
will return <a class="link" href="GtkDialog.html#GTK-RESPONSE-ACCEPT:CAPS"><span class="type">GTK_RESPONSE_ACCEPT</span></a> if the user accepted, and
<a class="link" href="GtkDialog.html#GTK-RESPONSE-CANCEL:CAPS"><span class="type">GTK_RESPONSE_CANCEL</span></a> if he pressed cancel. It can also return
<a class="link" href="GtkDialog.html#GTK-RESPONSE-DELETE-EVENT:CAPS"><span class="type">GTK_RESPONSE_DELETE_EVENT</span></a> if the window was unexpectedly closed.</p>
</div>
<div class="refsect3">
<a name="gtkfilechooserdialognative-differences"></a><h4>Differences from <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>
</h4>
<p>There are a few things in the GtkFileChooser API that are not
possible to use with <span class="type">GtkFileChooserNative</span>, as such use would
prohibit the use of a native dialog.</p>
<p>There is no support for the signals that are emitted when the user
navigates in the dialog, including:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><a class="link" href="GtkFileChooser.html#GtkFileChooser-current-folder-changed" title="The “current-folder-changed” signal"><span class="type">“current-folder-changed”</span></a></p></li>
<li class="listitem"><p><a class="link" href="GtkFileChooser.html#GtkFileChooser-selection-changed" title="The “selection-changed” signal"><span class="type">“selection-changed”</span></a></p></li>
<li class="listitem"><p><a class="link" href="GtkFileChooser.html#GtkFileChooser-file-activated" title="The “file-activated” signal"><span class="type">“file-activated”</span></a></p></li>
<li class="listitem"><p><a class="link" href="GtkFileChooser.html#GtkFileChooser-confirm-overwrite" title="The “confirm-overwrite” signal"><span class="type">“confirm-overwrite”</span></a></p></li>
</ul></div>
<p>You can also not use the methods that directly control user navigation:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>gtk_file_chooser_unselect_filename()</p></li>
<li class="listitem"><p>gtk_file_chooser_select_all()</p></li>
<li class="listitem"><p>gtk_file_chooser_unselect_all()</p></li>
</ul></div>
<p>If you need any of the above you will have to use <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a> directly.</p>
<p>No operations that change the the dialog work while the dialog is
visible. Set all the properties that are required before showing the dialog.</p>
</div>
<div class="refsect3">
<a name="gtkfilechooserdialognative-win32"></a><h4>Win32 details</h4>
<p>On windows the IFileDialog implementation (added in Windows Vista) is
used. It supports many of the features that <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>
does, but there are some things it does not handle:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Extra widgets added with <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-extra-widget" title="gtk_file_chooser_set_extra_widget ()"><code class="function">gtk_file_chooser_set_extra_widget()</code></a>.</p></li>
<li class="listitem"><p>Use of custom previews by connecting to <a class="link" href="GtkFileChooser.html#GtkFileChooser-update-preview" title="The “update-preview” signal"><span class="type">“update-preview”</span></a>.</p></li>
<li class="listitem"><p>Any <a class="link" href="GtkFileFilter.html" title="GtkFileFilter"><span class="type">GtkFileFilter</span></a> added using a mimetype or custom filter.</p></li>
</ul></div>
<p>If any of these features are used the regular <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>
will be used in place of the native one.</p>
</div>
<div class="refsect3">
<a name="gtkfilechooserdialognative-portal"></a><h4>Portal details</h4>
<p>When the org.freedesktop.portal.FileChooser portal is available on the
session bus, it is used to bring up an out-of-process file chooser. Depending
on the kind of session the application is running in, this may or may not
be a GTK+ file chooser. In this situation, the following things are not
supported and will be silently ignored:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Extra widgets added with <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-extra-widget" title="gtk_file_chooser_set_extra_widget ()"><code class="function">gtk_file_chooser_set_extra_widget()</code></a>.</p></li>
<li class="listitem"><p>Use of custom previews by connecting to <a class="link" href="GtkFileChooser.html#GtkFileChooser-update-preview" title="The “update-preview” signal"><span class="type">“update-preview”</span></a>.</p></li>
<li class="listitem"><p>Any <a class="link" href="GtkFileFilter.html" title="GtkFileFilter"><span class="type">GtkFileFilter</span></a> added with a custom filter.</p></li>
</ul></div>
</div>
<div class="refsect3">
<a name="gtkfilechooserdialognative-macos"></a><h4>macOS details</h4>
<p>On macOS the NSSavePanel and NSOpenPanel classes are used to provide native
file chooser dialogs. Some features provided by <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a> are
not supported:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>Extra widgets added with <a class="link" href="GtkFileChooser.html#gtk-file-chooser-set-extra-widget" title="gtk_file_chooser_set_extra_widget ()"><code class="function">gtk_file_chooser_set_extra_widget()</code></a>, unless the
widget is an instance of GtkLabel, in which case the label text will be used
to set the NSSavePanel message instance property.</p></li>
<li class="listitem"><p>Use of custom previews by connecting to <a class="link" href="GtkFileChooser.html#GtkFileChooser-update-preview" title="The “update-preview” signal"><span class="type">“update-preview”</span></a>.</p></li>
<li class="listitem"><p>Any <a class="link" href="GtkFileFilter.html" title="GtkFileFilter"><span class="type">GtkFileFilter</span></a> added with a custom filter.</p></li>
<li class="listitem"><p>Shortcut folders.</p></li>
</ul></div>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserNative.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-file-chooser-native-new"></a><h3>gtk_file_chooser_native_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GtkFileChooserNative</span> *
gtk_file_chooser_native_new (<em class="parameter"><code>const <span class="type">gchar</span> *title</code></em>,
<em class="parameter"><code><a class="link" href="GtkWindow.html" title="GtkWindow"><span class="type">GtkWindow</span></a> *parent</code></em>,
<em class="parameter"><code><a class="link" href="GtkFileChooser.html#GtkFileChooserAction" title="enum GtkFileChooserAction"><span class="type">GtkFileChooserAction</span></a> action</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *accept_label</code></em>,
<em class="parameter"><code>const <span class="type">gchar</span> *cancel_label</code></em>);</pre>
<p>Creates a new <span class="type">GtkFileChooserNative</span>.</p>
<div class="refsect3">
<a name="gtk-file-chooser-native-new.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>title</p></td>
<td class="parameter_description"><p>Title of the native, 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>
<tr>
<td class="parameter_name"><p>parent</p></td>
<td class="parameter_description"><p>Transient parent of the native, 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>
<tr>
<td class="parameter_name"><p>action</p></td>
<td class="parameter_description"><p>Open or save mode for the dialog</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>accept_label</p></td>
<td class="parameter_description"><p>text to go in the accept button, or <code class="literal">NULL</code> for the default. </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>
<tr>
<td class="parameter_name"><p>cancel_label</p></td>
<td class="parameter_description"><p>text to go in the cancel button, or <code class="literal">NULL</code> for the default. </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>
<div class="refsect3">
<a name="gtk-file-chooser-native-new.returns"></a><h4>Returns</h4>
<p> a new <span class="type">GtkFileChooserNative</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-file-chooser-native-get-accept-label"></a><h3>gtk_file_chooser_native_get_accept_label ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
gtk_file_chooser_native_get_accept_label
(<em class="parameter"><code><span class="type">GtkFileChooserNative</span> *self</code></em>);</pre>
<p>Retrieves the custom label text for the accept button.</p>
<div class="refsect3">
<a name="gtk-file-chooser-native-get-accept-label.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">GtFileChooserNative</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-native-get-accept-label.returns"></a><h4>Returns</h4>
<p>The custom label, or <code class="literal">NULL</code> for the default. This string
is owned by GTK+ and should 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-file-chooser-native-set-accept-label"></a><h3>gtk_file_chooser_native_set_accept_label ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_file_chooser_native_set_accept_label
(<em class="parameter"><code><span class="type">GtkFileChooserNative</span> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *accept_label</code></em>);</pre>
<p>Sets the custom label text for the accept button.</p>
<p>If characters in <em class="parameter"><code>label</code></em>
are preceded by an underscore, they are underlined.
If you need a literal underscore character in a label, use “__” (two
underscores). The first underlined character represents a keyboard
accelerator called a mnemonic.
Pressing Alt and that key activates the button.</p>
<div class="refsect3">
<a name="gtk-file-chooser-native-set-accept-label.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">GtFileChooserNative</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>accept_label</p></td>
<td class="parameter_description"><p>custom label or <code class="literal">NULL</code> for the default. </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-file-chooser-native-get-cancel-label"></a><h3>gtk_file_chooser_native_get_cancel_label ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
gtk_file_chooser_native_get_cancel_label
(<em class="parameter"><code><span class="type">GtkFileChooserNative</span> *self</code></em>);</pre>
<p>Retrieves the custom label text for the cancel button.</p>
<div class="refsect3">
<a name="gtk-file-chooser-native-get-cancel-label.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">GtFileChooserNative</span></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-native-get-cancel-label.returns"></a><h4>Returns</h4>
<p>The custom label, or <code class="literal">NULL</code> for the default. This string
is owned by GTK+ and should 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-file-chooser-native-set-cancel-label"></a><h3>gtk_file_chooser_native_set_cancel_label ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_file_chooser_native_set_cancel_label
(<em class="parameter"><code><span class="type">GtkFileChooserNative</span> *self</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *cancel_label</code></em>);</pre>
<p>Sets the custom label text for the cancel button.</p>
<p>If characters in <em class="parameter"><code>label</code></em>
are preceded by an underscore, they are underlined.
If you need a literal underscore character in a label, use “__” (two
underscores). The first underlined character represents a keyboard
accelerator called a mnemonic.
Pressing Alt and that key activates the button.</p>
<div class="refsect3">
<a name="gtk-file-chooser-native-set-cancel-label.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">GtFileChooserNative</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancel_label</p></td>
<td class="parameter_description"><p>custom label or <code class="literal">NULL</code> for the default. </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>
</div>
<div class="refsect1">
<a name="gtk3-GtkFileChooserNative.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a>, <span class="type">GtkNativeDialog</span>, <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>