gtk2/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml

158 lines
3.6 KiB
Plaintext
Raw Normal View History

2004-08-17 16:21:46 +00:00
<!-- ##### SECTION Title ##### -->
GtkFileChooserButton
<!-- ##### SECTION Short_Description ##### -->
2004-10-11 20:15:30 +00:00
A button to launch a file selection dialog
2004-08-17 16:21:46 +00:00
<!-- ##### 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>
2004-08-17 16:21:46 +00:00
<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 dialog
more space, you should call gtk_widget_size_request(), or pack it in
such a way that other interface elements give space to the widget.
2004-08-17 16:21:46 +00:00
</para>
</important>
2004-08-17 16:21:46 +00:00
<!-- ##### SECTION See_Also ##### -->
<para>
#GtkFileChooserDialog
2004-08-17 16:21:46 +00:00
</para>
<!-- ##### STRUCT GtkFileChooserButton ##### -->
<para>
This should not be accessed directly. Use the accessor functions below.
</para>
<!-- ##### ARG GtkFileChooserButton:active ##### -->
<para>
%TRUE, if the #GtkFileChooserDialog associated with the button has been
made visible. This can also be set by the application, though it is
rarely useful to do so.
</para>
2004-08-17 16:21:46 +00:00
<!-- ##### ARG GtkFileChooserButton:dialog ##### -->
<para>
Instance of the #GtkFileChooserDialog associated with the button.
2004-08-17 16:21:46 +00:00
</para>
<!-- ##### ARG GtkFileChooserButton:title ##### -->
<para>
Title to put on the #GtkFileChooserDialog associated with the button.
</para>
2004-08-17 16:21:46 +00:00
<!-- ##### 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: