Top | ![]() |
![]() |
![]() |
![]() |
XfceFileChooserXfceFileChooser — a wrapper around GtkFileSelection and GtkFileChooserDialog |
XfceFileChooser is meant to be used as a gtk-version-neutral file selector. If libxfcegui4 is compiled against GTK+ 2.0 or 2.2, XfceFileChooser will use the older GtkFileSelection. If libxfcegui4 is compiled against GTK+ 2.4 or greater, XfceFileChooser will use GtkFileChooserDialog. The API of XfceFileChooser is designed to be similar to that of the GtkFileChooser interface, and may behave differently from the older GtkFileSelection API.
void (*PreviewUpdateFunc) (XfceFileChooser *chooser
,gpointer user_data
);
Use this function prototype for functions to be passed to
xfce_file_chooser_set_preview_callback()
.
chooser |
The XfceFileChooser where the signal occurred. |
|
user_data |
The |
GtkWidget * xfce_file_chooser_dialog_new (const gchar *title
,GtkWindow *parent
,XfceFileChooserAction action
,const gchar *first_button_text
,...
);
xfce_file_chooser_dialog_new
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
title |
The dialog's window title, or |
|
parent |
The dialog's transient parent window, or |
|
action |
Open or save mode for dialog. |
|
first_button_text |
Stock ID or text for the first button. |
|
... |
Response ID for the first button, followed by additional (button, ID)
pairs, terminated with a |
GtkWidget * xfce_file_chooser_new (const gchar *title
,GtkWindow *parent
,XfceFileChooserAction action
,const gchar *first_button_text
,...
);
xfce_file_chooser_new
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Constructs a new file chooser dialog. If compiled against GTK+ 2.4 (or above), this will create a
GtkFileChooserDialog.For GTK+ 2.0 and 2.2, this creates a
GtkFileSelection.title |
The dialog's window title, or |
|
parent |
The dialog's transient parent window, or |
|
action |
Open or save mode for dialog. |
|
first_button_text |
Stock ID or text for the first button. |
|
... |
Response ID for the first button, followed by additional (button, ID)
pairs, terminated with a |
void xfce_file_chooser_set_select_multiple (XfceFileChooser *chooser
,gboolean select_multiple
);
xfce_file_chooser_set_select_multiple
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets whether multiple files can be selected in the file chooser.
gboolean
xfce_file_chooser_get_select_multiple (XfceFileChooser *chooser
);
xfce_file_chooser_get_select_multiple
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Gets whether multiple files can be selected in the file chooser. See
xfce_file_chooser_set_select_multiple()
.
void xfce_file_chooser_set_current_name (XfceFileChooser *chooser
,const gchar *name
);
xfce_file_chooser_set_current_name
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets the name to be displayed in the file chooser's entry box, as if entered by the user. This function is meant to be used, e.g., to suggest a file name to a user in a "Save as..." dialog.
To preselect a particular existing filename, see
xfce_file_chooser_set_filename()
.
gchar *
xfce_file_chooser_get_filename (XfceFileChooser *chooser
);
xfce_file_chooser_get_filename
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Returns the currently selected file in the file chooser. If multiple files are selected, behavior is indeterminate.
gboolean xfce_file_chooser_set_filename (XfceFileChooser *chooser
,const gchar *filename
);
xfce_file_chooser_set_filename
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets filename
as the currently selected file in the file chooser, changing
the file chooser's directory view if necessary.
Note that the file must exist, or nothing will occur except for possibly a
directory change. If you wish to suggest a file name to the user, use
xfce_file_chooser_set_current_name()
instead.
GSList *
xfce_file_chooser_get_filenames (XfceFileChooser *chooser
);
xfce_file_chooser_get_filenames
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Gets a list of file names selected in the file chooser. This is intended for
use when xfce_file_chooser_set_select_multiple()
is used to allow the
selection of multiple files.
A GSList
containing the filenames of all selected files in the file
chooser. Release the list with g_slist_free()
and the
filenames with g_free()
when they are no longer needed.
gboolean xfce_file_chooser_set_current_folder (XfceFileChooser *chooser
,const gchar *filename
);
xfce_file_chooser_set_current_folder
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets the current folder of chooser
to filename
.
gchar *
xfce_file_chooser_get_current_folder (XfceFileChooser *chooser
);
xfce_file_chooser_get_current_folder
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Gets the current folder visible in the file chooser.
void xfce_file_chooser_set_preview_widget (XfceFileChooser *chooser
,GtkWidget *preview_widget
);
xfce_file_chooser_set_preview_widget
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets an app-supplied widget to be shown as a "preview widget" for the file
chooser. To implement the preview, set a callback function using
xfce_file_chooser_set_preview_callback()
. In this callback function, use
xfce_file_chooser_get_filename()
to get the currently selected file.
Finally, use xfce_file_chooser_set_preview_widget_active()
to tell the file
chooser whether or not a preview should be shown for that file.
GtkWidget *
xfce_file_chooser_get_preview_widget (XfceFileChooser *chooser
);
xfce_file_chooser_get_preview_widget
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Retrieves the preview widget set by xfce_file_chooser_set_preview_widget()
.
void xfce_file_chooser_set_preview_callback (XfceFileChooser *chooser
,PreviewUpdateFunc func
,gpointer user_data
);
xfce_file_chooser_set_preview_callback
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets a callback function to be executed whenever the preview widget requires updating. Unfortunately, this method limits the application to a single callback function, but this should be sufficient for most uses.
chooser |
An XfceFileChooser. |
|
func |
A callback function. |
|
user_data |
Data to be passed to |
void xfce_file_chooser_set_preview_widget_active (XfceFileChooser *chooser
,gboolean active
);
xfce_file_chooser_set_preview_widget_active
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets whether or not the currently selected file supports some type of
preview, handled by the widget set with
xfce_file_chooser_set_preview_widget()
. This should be used in the preview
callback every time the selected file is changed.
chooser |
An XfceFileChooser. |
|
active |
|
gboolean
xfce_file_chooser_get_preview_widget_active
(XfceFileChooser *chooser
);
xfce_file_chooser_get_preview_widget_active
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Gets whether or not the preview widget is displayed for the current file.
See xfce_file_chooser_set_preview_widget_active()
.
void xfce_file_chooser_set_use_preview_label (XfceFileChooser *chooser
,gboolean use_label
);
xfce_file_chooser_set_use_preview_label
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets whether the file chooser should display a text label above the preview widget containing the name of the selected file.
chooser |
An XfceFileChooser. |
|
use_label |
Whether to display a stock label with the name of the previewed file. |
void xfce_file_chooser_set_extra_widget (XfceFileChooser *chooser
,GtkWidget *extra_widget
);
xfce_file_chooser_set_extra_widget
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets a widget to display in the file chooser to provide extra options to the user.
GtkWidget *
xfce_file_chooser_get_extra_widget (XfceFileChooser *chooser
);
xfce_file_chooser_get_extra_widget
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Gets the widget set with xfce_file_chooser_set_extra_widget()
.
void xfce_file_chooser_add_filter (XfceFileChooser *chooser
,XfceFileFilter *filter
);
xfce_file_chooser_add_filter
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Adds a filter to the list of filters that the user can select to restrict the view of the file chooser.
Note: This currently does nothing when libxfcegui4 is compiled against GTK+ 2.2 or lower.
chooser |
An XfceFileChooser. |
|
filter |
An XfceFileFilter created with |
void xfce_file_chooser_remove_filter (XfceFileChooser *chooser
,XfceFileFilter *filter
);
xfce_file_chooser_remove_filter
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Removes filter
from the list of filters displayed by the file chooser.
Note: This currently does nothing when libxfcegui4 is compiled against GTK+ 2.2 or lower.
void xfce_file_chooser_set_filter (XfceFileChooser *chooser
,XfceFileFilter *filter
);
xfce_file_chooser_set_filter
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets the file chooser's currently selected file filter to filter
. This
filter must have been added previously using xfce_file_chooser_add_filter()
.
Note: This currently does nothing when libxfcegui4 is compiled against GTK+ 2.2 or lower.
void xfce_file_chooser_set_local_only (XfceFileChooser *chooser
,gboolean local_only
);
xfce_file_chooser_set_local_only
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Sets whether or not the file chooser can display and/or allow the selection of non-local files.
gboolean
xfce_file_chooser_get_local_only (XfceFileChooser *chooser
);
xfce_file_chooser_get_local_only
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Gets whether or not the file chooser can display and/or allow the selection of non-local files.
gboolean xfce_file_chooser_add_shortcut_folder (XfceFileChooser *chooser
,const gchar *folder
,GError **error
);
xfce_file_chooser_add_shortcut_folder
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Adds a folder to be displayed in the shortcut folders list in the file chooser. The folder name is validated, so only valid paths may be added.
Note: This currently does nothing when libxfcegui4 is compiled against GTK+ 2.2 or lower.
chooser |
An XfceFileChooser. |
|
folder |
The full path to a folder name. |
|
error |
Location to store any errors, or |
gboolean xfce_file_chooser_remove_shortcut_folder (XfceFileChooser *chooser
,const gchar *folder
,GError **error
);
xfce_file_chooser_remove_shortcut_folder
is deprecated and should not be used in newly-written code.
Use GtkFileChooser instead.
Since 4.1
Removes the specified folder from the file chooser's shortcut folder list.
Note: This currently does nothing when libxfcegui4 is compiled against GTK+ 2.2 or lower.
chooser |
An XfceFileChooser. |
|
folder |
The full path to an existing shortcut folder name. |
|
error |
Location to store any errors, or |
XfceFileFilter *
xfce_file_filter_new (void
);
xfce_file_filter_new
is deprecated and should not be used in newly-written code.
Use GtkFileFilter instead.
Since 4.1
Create a new empty file filter.
Note: this will always return NULL
when libxfcegui4 is compiled against GTK+
2.2 or below, as file filters are not supported.
void xfce_file_filter_set_name (XfceFileFilter *filter
,const gchar *name
);
xfce_file_filter_set_name
is deprecated and should not be used in newly-written code.
Use GtkFileFilter instead.
Since 4.1
Sets a name to be displayed in in the option menu which describes the filter's purpose.
Note: this function has no effect when libxfcegui4 is compiled against GTK+ 2.2 or below, as file filters are not supported.
void xfce_file_filter_add_mime_type (XfceFileFilter *filter
,const gchar *mime_type
);
xfce_file_filter_add_mime_type
is deprecated and should not be used in newly-written code.
Use GtkFileFilter instead.
Since 4.1
Adds a MIME type to the file filter. All files matching this MIME type will be displayed in the file chooser when the filter is selected.
Note: this function has no effect when libxfcegui4 is compiled against GTK+ 2.2 or below, as file filters are not supported.
void xfce_file_filter_add_pattern (XfceFileFilter *filter
,const gchar *pattern
);
xfce_file_filter_add_pattern
is deprecated and should not be used in newly-written code.
Use GtkFileFilter instead.
Since 4.1
Adds a shell-glob-type file pattern to the file filter. All files matching the pattern will be displayed in the file chooser when the filter is selected.
Note: this function has no effect when libxfcegui4 is compiled against GTK+ 2.2 or below, as file filters are not supported.
Describes whether a XfceFileChooser is being used to open existing files or to save to a possibly new file.
Indicates open mode. The file chooser will only let the user pick an existing file. |
||
Indicates save mode. The file chooser will let the user pick an existing file, or type in a new filename. |
||
Indicates an Open mode for selecting folders. The file chooser will let the user pick an existing folder. |
||
Indicates a mode for creating a new folder. The file chooser will let the user name an existing or new folder. |
typedef GtkObject XfceFileFilter;
With GTK+ 2.4, this object is mapped to a
GtkFileFilter.
However, with GTK+ 2.0 or 2.2, this object doesn't exist, so functions that use
it will return and expect a NULL
value. As such, pointers to an
XfceFileFilter should be treated as opaque, and no attempt should be made to
dereference them.