forked from AuroraMiddleware/gtk
ede3c39918
2004-10-25 James M. Cape <jcape@ignore-your.tv> Rework of GtkFileChooserButton, some cleanups. Fixes #154388, #154390, #154390, #156272. * docs/reference/gtk/gtk-docs.sgml: Moved GtkFileChooserButton below GtkFileChooser. * docs/reference/gtk/gtk-sections.txt: Added gtk_file_chooser_button_get_width_chars(), gtk_file_chooser_button_set_width_chars(), gtk_label_set_width_chars(), gtk_label_get_width_chars(). * docs/reference/gtk/gtk.types: Added gtk_cell_renderer_combo_get_type, gtk_cell_view_get_type, gtk_text_iter_get_type. * docs/reference/gtk/tmpl/gtkaboutdialog.sgml: Add "logo-icon-name" property. * docs/reference/gtk/tmpl/gtkcellview.sgml: Updates for properties (b/c of get_type() inclusion above). * docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml: * docs/reference/gtk/tmpl/gtklabel.sgml: Add "width-chars" property, getters/setters. * docs/reference/gtk/tmpl/gtkcellrenderercombo.sgml: Added. * gtk/gtkentrycompletion.c: (_gtk_entry_completion_popdown): Don't show if the entry isn't mapped. * gtk/gtkfilechooserbutton.[c,h]: (*): About 45% rewritten, adds "width-chars" property, icons, working save modes, volume/Home/Desktop friendly-naming support. * gtk/gtklabel.[c,h]: (gtk_label_class_init), (gtk_label_init), (gtk_label_get_property), (gtk_label_set_property), (gtk_label_get_width_chars), (gtk_label_set_width_chars), (gtk_label_size_request): Add "width-chars" property. * tests/testfilechooserbutton.c: Update, use 4 different buttons for the different ACTIONs. * gtk/.cvsignore: Ignore gtk-update-icon-cache. * tests/.cvsignore: Ignore testimage.
182 lines
4.0 KiB
Plaintext
182 lines
4.0 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>
|
|
%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>
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:dialog ##### -->
|
|
<para>
|
|
Instance of the #GtkFileChooserDialog associated with the button.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:title ##### -->
|
|
<para>
|
|
Title to put on the #GtkFileChooserDialog associated with the button.
|
|
</para>
|
|
|
|
<!-- ##### ARG GtkFileChooserButton:width-chars ##### -->
|
|
<para>
|
|
The width of the entry and label inside the button, in characters.
|
|
</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:
|
|
|
|
|