gtk3/docs/reference/gtk/html/GtkFileChooserButton.html
2017-12-21 20:47:04 -05:00

620 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.

This file contains Unicode characters that might be confused with other characters. 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>GtkFileChooserButton: 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="GtkFileChooser.html" title="GtkFileChooser">
<link rel="next" href="gtk3-GtkFileChooserNative.html" title="GtkFileChooserNative">
<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="#GtkFileChooserButton.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
<a href="#GtkFileChooserButton.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
<a href="#GtkFileChooserButton.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span> 
<a href="#GtkFileChooserButton.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
<a href="#GtkFileChooserButton.signals" class="shortcut">Signals</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="GtkFileChooser.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gtk3-GtkFileChooserNative.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkFileChooserButton"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkFileChooserButton.top_of_page"></a>GtkFileChooserButton</span></h2>
<p>GtkFileChooserButton — A button to launch a file selection dialog</p>
</td>
<td class="gallery_image" valign="top" align="right"><img src="file-button.png"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkFileChooserButton.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">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-new" title="gtk_file_chooser_button_new ()">gtk_file_chooser_button_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-new-with-dialog" title="gtk_file_chooser_button_new_with_dialog ()">gtk_file_chooser_button_new_with_dialog</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-get-title" title="gtk_file_chooser_button_get_title ()">gtk_file_chooser_button_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="GtkFileChooserButton.html#gtk-file-chooser-button-set-title" title="gtk_file_chooser_button_set_title ()">gtk_file_chooser_button_set_title</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-get-width-chars" title="gtk_file_chooser_button_get_width_chars ()">gtk_file_chooser_button_get_width_chars</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="GtkFileChooserButton.html#gtk-file-chooser-button-set-width-chars" title="gtk_file_chooser_button_set_width_chars ()">gtk_file_chooser_button_set_width_chars</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-get-focus-on-click" title="gtk_file_chooser_button_get_focus_on_click ()">gtk_file_chooser_button_get_focus_on_click</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="GtkFileChooserButton.html#gtk-file-chooser-button-set-focus-on-click" title="gtk_file_chooser_button_set_focus_on_click ()">gtk_file_chooser_button_set_focus_on_click</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *</td>
<td class="property_name"><a class="link" href="GtkFileChooserButton.html#GtkFileChooserButton--dialog" title="The “dialog” property">dialog</a></td>
<td class="property_flags">Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GtkFileChooserButton.html#GtkFileChooserButton--title" title="The “title” property">title</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
<td class="property_name"><a class="link" href="GtkFileChooserButton.html#GtkFileChooserButton--width-chars" title="The “width-chars” property">width-chars</a></td>
<td class="property_flags">Read / Write</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
</colgroup>
<tbody><tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GtkFileChooserButton.html#GtkFileChooserButton-file-set" title="The “file-set” signal">file-set</a></td>
<td class="signal_flags"><a href="../gobject/gobject-Signals.html#G-SIGNAL-RUN-FIRST:CAPS">Run First</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.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="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkFileChooserButton.html#GtkFileChooserButton-struct" title="struct GtkFileChooserButton">GtkFileChooserButton</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GtkFileChooserButton.html#GtkFileChooserButtonClass" title="struct GtkFileChooserButtonClass">GtkFileChooserButtonClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> <a href="../gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
<span class="lineart">╰──</span> <a href="../gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a>
<span class="lineart">╰──</span> <a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
<span class="lineart">╰──</span> <a class="link" href="GtkContainer.html" title="GtkContainer">GtkContainer</a>
<span class="lineart">╰──</span> <a class="link" href="GtkBox.html" title="GtkBox">GtkBox</a>
<span class="lineart">╰──</span> GtkFileChooserButton
</pre>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkFileChooserButton implements
AtkImplementorIface, <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>, <a class="link" href="gtk3-Orientable.html#GtkOrientable">GtkOrientable</a> and <a class="link" href="GtkFileChooser.html" title="GtkFileChooser">GtkFileChooser</a>.</p>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.description"></a><h2>Description</h2>
<p>The <a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> is a widget that lets the user select a
file. It implements the <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> interface. Visually, it is a
file name with a button to bring up a <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>.
The user can then use that dialog to change the file associated with
that button. This widget does not support setting the
<a class="link" href="GtkFileChooser.html#GtkFileChooser--select-multiple" title="The “select-multiple” property"><span class="type">“select-multiple”</span></a> property to <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
<div class="refsect3">
<a name="id-1.3.14.7.10.3"></a><h4>Create a button to let the user select a file in /etc</h4>
<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</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc opt">{</span>
GtkWidget <span class="gtkdoc opt">*</span>button<span class="gtkdoc opt">;</span>
button <span class="gtkdoc opt">=</span> <span class="function"><a href="GtkFileChooserButton.html#gtk-file-chooser-button-new">gtk_file_chooser_button_new</a></span> <span class="gtkdoc opt">(</span><span class="function">_</span><span class="gtkdoc opt">(</span><span class="string">&quot;Select a file&quot;</span><span class="gtkdoc opt">),</span>
GTK_FILE_CHOOSER_ACTION_OPEN<span class="gtkdoc opt">);</span>
<span class="function"><a href="GtkFileChooser.html#gtk-file-chooser-set-current-folder">gtk_file_chooser_set_current_folder</a></span> <span class="gtkdoc opt">(</span><span class="function">GTK_FILE_CHOOSER</span> <span class="gtkdoc opt">(</span>button<span class="gtkdoc opt">),</span>
<span class="string">&quot;/etc&quot;</span><span class="gtkdoc opt">);</span>
<span class="gtkdoc opt">}</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>The <a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> supports the <a href="GtkFileChooser.html#GtkFileChooserAction"><span class="type">GtkFileChooserActions</span></a>
<a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-OPEN:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_OPEN</code></a> and <a class="link" href="GtkFileChooser.html#GTK-FILE-CHOOSER-ACTION-SELECT-FOLDER:CAPS"><code class="literal">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</code></a>.</p>
<div class="blockquote"><blockquote class="blockquote"><p>The <a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> will ellipsize the label, and will thus
request little horizontal space. To give the button more space,
you should call <a class="link" href="GtkWidget.html#gtk-widget-get-preferred-size" title="gtk_widget_get_preferred_size ()"><code class="function">gtk_widget_get_preferred_size()</code></a>,
<a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-set-width-chars" title="gtk_file_chooser_button_set_width_chars ()"><code class="function">gtk_file_chooser_button_set_width_chars()</code></a>, or pack the button in
such a way that other interface elements give space to the
widget.</p></blockquote></div>
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gtk-file-chooser-button-new"></a><h3>gtk_file_chooser_button_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_file_chooser_button_new (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</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>);</pre>
<p>Creates a new file-selecting button widget.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-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>the title of the browse dialog.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>action</p></td>
<td class="parameter_description"><p>the open mode for the widget.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-button-new.returns"></a><h4>Returns</h4>
<p> a new button widget.</p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-new-with-dialog"></a><h3>gtk_file_chooser_button_new_with_dialog ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *
gtk_file_chooser_button_new_with_dialog
(<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *dialog</code></em>);</pre>
<p>Creates a <a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> widget which uses <em class="parameter"><code>dialog</code></em>
as its
file-picking window.</p>
<p>Note that <em class="parameter"><code>dialog</code></em>
must be a <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a> (or subclass) which
implements the <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> interface and must not have
<a class="link" href="GtkDialog.html#GTK-DIALOG-DESTROY-WITH-PARENT:CAPS"><code class="literal">GTK_DIALOG_DESTROY_WITH_PARENT</code></a> set.</p>
<p>Also note that the dialog needs to have its confirmative button
added with response <a class="link" href="GtkDialog.html#GTK-RESPONSE-ACCEPT:CAPS"><code class="literal">GTK_RESPONSE_ACCEPT</code></a> or <a class="link" href="GtkDialog.html#GTK-RESPONSE-OK:CAPS"><code class="literal">GTK_RESPONSE_OK</code></a> in
order for the button to take over the file selected in the dialog.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-new-with-dialog.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>dialog</p></td>
<td class="parameter_description"><p> the widget to use as dialog. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> Gtk.Dialog]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-button-new-with-dialog.returns"></a><h4>Returns</h4>
<p> a new button widget.</p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-get-title"></a><h3>gtk_file_chooser_button_get_title ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
gtk_file_chooser_button_get_title (<em class="parameter"><code><a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);</pre>
<p>Retrieves the title of the browse dialog used by <em class="parameter"><code>button</code></em>
. The returned value
should not be modified or freed.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-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>button</p></td>
<td class="parameter_description"><p>the button widget to examine.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-button-get-title.returns"></a><h4>Returns</h4>
<p> a pointer to the browse dialogs title.</p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-set-title"></a><h3>gtk_file_chooser_button_set_title ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_file_chooser_button_set_title (<em class="parameter"><code><a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *title</code></em>);</pre>
<p>Modifies the <em class="parameter"><code>title</code></em>
of the browse dialog used by <em class="parameter"><code>button</code></em>
.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-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>button</p></td>
<td class="parameter_description"><p>the button widget to modify.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>title</p></td>
<td class="parameter_description"><p>the new browse dialog title.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-get-width-chars"></a><h3>gtk_file_chooser_button_get_width_chars ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>
gtk_file_chooser_button_get_width_chars
(<em class="parameter"><code><a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);</pre>
<p>Retrieves the width in characters of the <em class="parameter"><code>button</code></em>
widgets entry and/or label.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-get-width-chars.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>button</p></td>
<td class="parameter_description"><p>the button widget to examine.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-button-get-width-chars.returns"></a><h4>Returns</h4>
<p> an integer width (in characters) that the button will use to size itself.</p>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-set-width-chars"></a><h3>gtk_file_chooser_button_set_width_chars ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_file_chooser_button_set_width_chars
(<em class="parameter"><code><a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> n_chars</code></em>);</pre>
<p>Sets the width (in characters) that <em class="parameter"><code>button</code></em>
will use to <em class="parameter"><code>n_chars</code></em>
.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-set-width-chars.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>button</p></td>
<td class="parameter_description"><p>the button widget to examine.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n_chars</p></td>
<td class="parameter_description"><p>the new width, in characters.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-get-focus-on-click"></a><h3>gtk_file_chooser_button_get_focus_on_click ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gtk_file_chooser_button_get_focus_on_click
(<em class="parameter"><code><a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_file_chooser_button_get_focus_on_click</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="GtkWidget.html#gtk-widget-get-focus-on-click" title="gtk_widget_get_focus_on_click ()"><code class="function">gtk_widget_get_focus_on_click()</code></a> instead</p>
</div>
<p>Returns whether the button grabs focus when it is clicked with the mouse.
See <a class="link" href="GtkFileChooserButton.html#gtk-file-chooser-button-set-focus-on-click" title="gtk_file_chooser_button_set_focus_on_click ()"><code class="function">gtk_file_chooser_button_set_focus_on_click()</code></a>.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-get-focus-on-click.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>button</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-file-chooser-button-get-focus-on-click.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the button grabs focus when it is clicked with
the mouse.</p>
</div>
<p class="since">Since: 2.10</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-file-chooser-button-set-focus-on-click"></a><h3>gtk_file_chooser_button_set_focus_on_click ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_file_chooser_button_set_focus_on_click
(<em class="parameter"><code><a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *button</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> focus_on_click</code></em>);</pre>
<div class="warning">
<p><code class="literal">gtk_file_chooser_button_set_focus_on_click</code> has been deprecated since version 3.20 and should not be used in newly-written code.</p>
<p>Use <a class="link" href="GtkWidget.html#gtk-widget-set-focus-on-click" title="gtk_widget_set_focus_on_click ()"><code class="function">gtk_widget_set_focus_on_click()</code></a> instead</p>
</div>
<p>Sets whether the button will grab focus when it is clicked with the mouse.
Making mouse clicks not grab focus is useful in places like toolbars where
you dont want the keyboard focus removed from the main area of the
application.</p>
<div class="refsect3">
<a name="gtk-file-chooser-button-set-focus-on-click.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>button</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>focus_on_click</p></td>
<td class="parameter_description"><p>whether the button grabs focus when clicked with the mouse</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.10</p>
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkFileChooserButton-struct"></a><h3>struct GtkFileChooserButton</h3>
<pre class="programlisting">struct GtkFileChooserButton;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkFileChooserButtonClass"></a><h3>struct GtkFileChooserButtonClass</h3>
<pre class="programlisting">struct GtkFileChooserButtonClass {
GtkBoxClass parent_class;
void (* file_set) (GtkFileChooserButton *fc);
};
</pre>
<div class="refsect3">
<a name="GtkFileChooserButtonClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody><tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkFileChooserButtonClass.file-set"></a>file_set</code></em> ()</p></td>
<td class="struct_member_description"><p>Signal emitted when the user selects a file.</p></td>
<td class="struct_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkFileChooserButton--dialog"></a><h3>The <code class="literal">“dialog”</code> property</h3>
<pre class="programlisting"> “dialog” <a class="link" href="GtkFileChooser.html" title="GtkFileChooser"><span class="type">GtkFileChooser</span></a> *</pre>
<p>Instance of the <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a> associated with the button.</p>
<p>Flags: Write / Construct Only</p>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkFileChooserButton--title"></a><h3>The <code class="literal">“title”</code> property</h3>
<pre class="programlisting"> “title” <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>Title to put on the <a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a> associated with the button.</p>
<p>Flags: Read / Write</p>
<p>Default value: "Select a File"</p>
<p class="since">Since: 2.6</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkFileChooserButton--width-chars"></a><h3>The <code class="literal">“width-chars”</code> property</h3>
<pre class="programlisting"> “width-chars” <a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></pre>
<p>The width of the entry and label inside the button, in characters.</p>
<p>Flags: Read / Write</p>
<p>Allowed values: &gt;= -1</p>
<p>Default value: -1</p>
<p class="since">Since: 2.6</p>
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GtkFileChooserButton-file-set"></a><h3>The <code class="literal">“file-set”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="GtkFileChooserButton.html" title="GtkFileChooserButton"><span class="type">GtkFileChooserButton</span></a> *widget,
<a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre>
<p>The ::file-set signal is emitted when the user selects a file.</p>
<p>Note that this signal is only emitted when the user
changes the file.</p>
<div class="refsect3">
<a name="GtkFileChooserButton-file-set.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>widget</p></td>
<td class="parameter_description"><p>the object which received the signal.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: <a href="../gobject/gobject-Signals.html#G-SIGNAL-RUN-FIRST:CAPS">Run First</a></p>
<p class="since">Since: 2.12</p>
</div>
</div>
<div class="refsect1">
<a name="GtkFileChooserButton.see-also"></a><h2>See Also</h2>
<p><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.25.1</div>
</body>
</html>