GimpUi.FileChooser¶
- Subclasses:
 None
Methods¶
- Inherited:
 Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2)
- Structs:
 Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
Properties¶
- Inherited:
 Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w/en  | 
The action determining the chooser UI  | 
||
r/w/en  | 
The currently selected file  | 
||
r/w/en  | 
The label to be used next to the button  | 
||
r/w/en  | 
The title to be used for the file selection popup dialog and as placeholder text in file entry.  | 
Child Properties¶
- Inherited:
 
Style Properties¶
- Inherited:
 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Class Details¶
- class GimpUi.FileChooser(*args, **kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
The chooser contains an optional label and other interface allowing to select files for different use cases.
New in version 3.0.
- classmethod new(action, label, title, file)¶
 - Parameters:
 - Returns:
 A [class`GimpUi`.FileChooser].
- Return type:
 
Creates a new
Gtk.Widgetthat lets a user choose a file according to action.[enum`Gimp`.FileChooserAction.ANY] is not a valid value for action.
New in version 3.0.
- get_action()¶
 - Returns:
 the action which determined the UI of self.
- Return type:
 
Gets the current action.
New in version 3.0.
- get_file()¶
 - Returns:
 an internal copy of the file which must not be freed.
- Return type:
 
Gets the currently selected file.
New in version 3.0.
- get_label()¶
 - 
Gets the current label text. A
Nonelabel means that the label widget is hidden.Note: the label text may contain a mnemonic.
New in version 3.0.
 
- get_label_widget()¶
 - Returns:
 the [class`Gtk`.Widget] showing the label text.
- Return type:
 
Returns the label widget. This can be useful for instance when aligning dialog’s widgets with a [class`Gtk`.SizeGroup].
New in version 3.0.
- get_title()¶
 - 
Gets the text currently used for the file dialog’s title and for entry’s placeholder text.
A
Nonevalue means that the file dialog uses default title and the entry has no placeholder text.New in version 3.0.
 
- set_action(action)¶
 - Parameters:
 action (
Gimp.FileChooserAction) – Action to set.
Changes how self is set to select a file. It may completely change the internal widget structure so you should not depend on a specific widget composition.
Warning: with GTK deprecations, we may have soon to change the internal implementation. So this is all the more reason for you not to rely on specific child widgets being present (e.g.: we use currently [class`Gtk`.FileChooserButton] internally but it was removed in GTK4 so we will eventually replace it by custom code). We will also likely move to native file dialogs at some point.
[enum`Gimp`.FileChooserAction.ANY] is not a valid value for action.
New in version 3.0.
- set_file(file)¶
 - Parameters:
 file (
Gio.File) – File to set.
Sets the currently selected file.
New in version 3.0.
- set_label(text)¶
 - 
Set the label text with mnemonic.
Setting a
Nonelabel text will hide the label widget.New in version 3.0.
 
Property Details¶
- GimpUi.FileChooser.props.action¶
 - Name:
 action- Type:
 - Default Value:
 - Flags:
 
The action determining the chooser UI.
New in version 3.0.
- GimpUi.FileChooser.props.file¶
 - Name:
 file- Type:
 - Default Value:
 - Flags:
 
The currently selected file.
New in version 3.0.
- GimpUi.FileChooser.props.label¶
 - Name:
 label- Type:
 - Default Value:
 - Flags:
 
Label text with mnemonic.
New in version 3.0.