forked from AuroraMiddleware/gtk
180 lines
3.6 KiB
Plaintext
180 lines
3.6 KiB
Plaintext
<!-- ##### SECTION Title ##### -->
|
|
GtkFileChooserButton
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
A button to launch a file selection dialog
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
<para>
|
|
The #GtkFileChooserButton is a widget that lets the user select a
|
|
file. It implements the #GtkFileChooser interface. Visually, it is a
|
|
file name with a button to bring up a #GtkFileChooserDialog.
|
|
The user can then use that dialog to change the file associated with
|
|
that button. This widget does not support setting the "select-multiple"
|
|
property to %TRUE.
|
|
</para>
|
|
|
|
<example>
|
|
<title>Create a button to let the user select a file in /etc</title>
|
|
<programlisting>
|
|
{
|
|
GtkWidget *button;
|
|
|
|
button = gtk_file_chooser_button_new (_("Select a file"));
|
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
|
|
"/etc");
|
|
}
|
|
</programlisting>
|
|
</example>
|
|
|
|
<para>
|
|
The #GtkFileChooserButton supports all four #GtkFileChooserAction<!--
|
|
-->s that the #GtkFileChooser supports. Two of the actions,
|
|
%GTK_FILE_CHOOSER_ACTION_SAVE and
|
|
%GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, give the button the appearance
|
|
of an entry next to a button. The user can type the name of a file in
|
|
this entry, and it will complete as it types. The other two actions,
|
|
%GTK_FILE_CHOOSER_ACTION_OPEN and
|
|
%GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, make the #GtkFileChooserAction
|
|
look like a #GtkButton.
|
|
</para>
|
|
|
|
<example>
|
|
<title>Using GtkFileChooserButton in save mode</title>
|
|
<programlisting>
|
|
{
|
|
GtkWidget *button;
|
|
|
|
button = gtk_file_chooser_button_new (_("Save as..."));
|
|
gtk_file_chooser_set_action (GTK_FILE_CHOOSER (button),
|
|
GTK_FILE_CHOOSER_ACTION_SAVE);
|
|
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER_BUTTON (button),
|
|
DEFAULT_SAVE_DIRECTORY);
|
|
}
|
|
</programlisting>
|
|
</example>
|
|
|
|
<important>
|
|
<para>
|
|
The #GtkFileChooserButton will ellipsize the label while in Open mode,
|
|
and thus will thus request little horizontal space. To give the button
|
|
more space, you should call gtk_widget_size_request(),
|
|
gtk_file_chooser_button_set_width_chars(), or pack the button in
|
|
such a way that other interface elements give space to the widget.
|
|
</para>
|
|
</important>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
#GtkFileChooserDialog
|
|
</para>
|
|
|
|
<!-- ##### STRUCT GtkFileChooserButton ##### -->
|
|
<para>
|
|
This should not be accessed directly. Use the accessor functions below.
|
|
</para>
|
|
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:active ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:dialog ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:title ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:width-chars ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_new ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@title:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_new_with_backend ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@title:
|
|
@backend:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_new_with_dialog ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@dialog:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_get_title ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@button:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_set_title ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@button:
|
|
@title:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_get_active ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@button:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_set_active ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@button:
|
|
@is_active:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_get_width_chars ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@button:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION gtk_file_chooser_button_set_width_chars ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@button:
|
|
@n_chars:
|
|
|
|
|