Class FileChooserWidget
- All Implemented Interfaces:
Accessible, Buildable, ConstraintTarget, FileChooser, Proxy
GtkFileChooserWidget is a widget for choosing files.
It exposes the FileChooser interface, and you should
use the methods of this interface to interact with the
widget.
Shortcuts and Gestures
GtkFileChooserWidget supports the following keyboard shortcuts:
- Shift+F10 or Menu opens the context menu.
The following signals have default keybindings:
Gtk.FileChooserWidget::desktop-folderGtk.FileChooserWidget::down-folderGtk.FileChooserWidget::home-folderGtk.FileChooserWidget::location-popupGtk.FileChooserWidget::location-popup-on-pasteGtk.FileChooserWidget::location-toggle-popupGtk.FileChooserWidget::places-shortcutGtk.FileChooserWidget::quick-bookmarkGtk.FileChooserWidget::recent-shortcutGtk.FileChooserWidget::search-shortcutGtk.FileChooserWidget::show-hiddenGtk.FileChooserWidget::up-folder
CSS nodes
GtkFileChooserWidget has a single CSS node with name filechooser.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFileChooserWidget.Builder<B extends FileChooserWidget.Builder<B>>Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static interfaceDeprecated.Functional interface declaration of theDesktopFolderCallbackcallback.static interfaceDeprecated.Functional interface declaration of theDownFolderCallbackcallback.static interfaceDeprecated.Functional interface declaration of theHomeFolderCallbackcallback.static interfaceDeprecated.Functional interface declaration of theLocationPopupCallbackcallback.static interfaceDeprecated.Functional interface declaration of theLocationPopupOnPasteCallbackcallback.static interfaceDeprecated.Functional interface declaration of theLocationTogglePopupCallbackcallback.static interfaceDeprecated.Functional interface declaration of thePlacesShortcutCallbackcallback.static interfaceDeprecated.Functional interface declaration of theQuickBookmarkCallbackcallback.static interfaceDeprecated.Functional interface declaration of theRecentShortcutCallbackcallback.static interfaceDeprecated.Functional interface declaration of theSearchShortcutCallbackcallback.static interfaceDeprecated.Functional interface declaration of theShowHiddenCallbackcallback.static interfaceDeprecated.Functional interface declaration of theUpFolderCallbackcallback.Nested classes/interfaces inherited from class Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterfaceNested classes/interfaces inherited from interface FileChooser
FileChooser.FileChooser$Impl -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Create a new FileChooserWidget.FileChooserWidget(MemorySegment address) Deprecated.Create a FileChooserWidget instance for the provided memory address.FileChooserWidget(FileChooserAction action) Deprecated.Direct use ofGtkFileChooserWidgetis deprecated -
Method Summary
Modifier and TypeMethodDescriptionprotected FileChooserWidgetasParent()Deprecated.Return this instance as if it were its parent type.static FileChooserWidget.Builder<? extends FileChooserWidget.Builder> builder()Deprecated.AFileChooserWidget.Builderobject constructs aFileChooserWidgetwith the specified properties.voidDeprecated.Emits the "desktop-folder" signal.voidDeprecated.Emits the "down-folder" signal.voidDeprecated.Emits the "home-folder" signal.voidemitLocationPopup(String path) Deprecated.Emits the "location-popup" signal.voidDeprecated.Emits the "location-popup-on-paste" signal.voidDeprecated.Emits the "location-toggle-popup" signal.voidDeprecated.Emits the "places-shortcut" signal.voidemitQuickBookmark(int bookmarkIndex) Deprecated.Emits the "quick-bookmark" signal.voidDeprecated.Emits the "recent-shortcut" signal.voidDeprecated.Emits the "search-shortcut" signal.voidDeprecated.Emits the "show-hidden" signal.voidDeprecated.Emits the "up-folder" signal.static MemoryLayoutDeprecated.The memory layout of the native struct.static @Nullable TypegetType()Deprecated.Get the GType of the FileChooserWidget class.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Deprecated.Emitted when the user asks for it.Methods inherited from class Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlagsMethods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Accessible
announce, getAccessibleId, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface Buildable
getBuildableIdMethods inherited from interface FileChooser
addChoice, addFilter, addShortcutFolder, getAction, getChoice, getCreateFolders, getCurrentFolder, getCurrentName, getFile, getFiles, getFilter, getFilters, getSelectMultiple, getShortcutFolders, removeChoice, removeFilter, removeShortcutFolder, setAction, setChoice, setCreateFolders, setCurrentFolder, setCurrentName, setFile, setFilter, setSelectMultiple
-
Constructor Details
-
FileChooserWidget
Deprecated.Create a FileChooserWidget instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
FileChooserWidget
Deprecated.Direct use ofGtkFileChooserWidgetis deprecatedCreates a new
GtkFileChooserWidget.This is a file chooser widget that can be embedded in custom windows, and it is the same widget that is used by
GtkFileChooserDialog.- Parameters:
action- Open or save mode for the widget
-
FileChooserWidget
public FileChooserWidget()Deprecated.Create a new FileChooserWidget.
-
-
Method Details
-
getType
Deprecated.Get the GType of the FileChooserWidget class.- Returns:
- the GType
-
getMemoryLayout
Deprecated.The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Deprecated.Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
onDesktopFolder
public SignalConnection<FileChooserWidget.DesktopFolderCallback> onDesktopFolder(FileChooserWidget.DesktopFolderCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the user's Desktop folder in the file list.
The default binding for this signal is Alt-D.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDesktopFolder
public void emitDesktopFolder()Deprecated.Emits the "desktop-folder" signal. SeeonDesktopFolder(FileChooserWidget.DesktopFolderCallback). -
onDownFolder
public SignalConnection<FileChooserWidget.DownFolderCallback> onDownFolder(FileChooserWidget.DownFolderCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser go to a child of the current folder in the file hierarchy. The subfolder that will be used is displayed in the path bar widget of the file chooser. For example, if the path bar is showing "/foo/bar/baz", with bar currently displayed, then this will cause the file chooser to switch to the "baz" subfolder.
The default binding for this signal is Alt-Down.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitDownFolder
public void emitDownFolder()Deprecated.Emits the "down-folder" signal. SeeonDownFolder(FileChooserWidget.DownFolderCallback). -
onHomeFolder
public SignalConnection<FileChooserWidget.HomeFolderCallback> onHomeFolder(FileChooserWidget.HomeFolderCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the user's home folder in the file list.
The default binding for this signal is Alt-Home.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitHomeFolder
public void emitHomeFolder()Deprecated.Emits the "home-folder" signal. SeeonHomeFolder(FileChooserWidget.HomeFolderCallback). -
onLocationPopup
public SignalConnection<FileChooserWidget.LocationPopupCallback> onLocationPopup(FileChooserWidget.LocationPopupCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show a "Location" prompt which the user can use to manually type the name of the file he wishes to select.
The default bindings for this signal are Control-L with a
pathstring of "" (the empty string). It is also bound to / with apathstring of "/" (a slash): this lets you type/and immediately type a path name. On Unix systems, this is bound to ~ (tilde) with apathstring of "~" itself for access to home directories.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitLocationPopup
Deprecated.Emits the "location-popup" signal. SeeonLocationPopup(FileChooserWidget.LocationPopupCallback). -
onLocationPopupOnPaste
public SignalConnection<FileChooserWidget.LocationPopupOnPasteCallback> onLocationPopupOnPaste(FileChooserWidget.LocationPopupOnPasteCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show a "Location" prompt when the user pastes into a
GtkFileChooserWidget.The default binding for this signal is Control-V.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitLocationPopupOnPaste
public void emitLocationPopupOnPaste()Deprecated.Emits the "location-popup-on-paste" signal. SeeonLocationPopupOnPaste(FileChooserWidget.LocationPopupOnPasteCallback). -
onLocationTogglePopup
public SignalConnection<FileChooserWidget.LocationTogglePopupCallback> onLocationTogglePopup(FileChooserWidget.LocationTogglePopupCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to toggle the visibility of a "Location" prompt which the user can use to manually type the name of the file he wishes to select.
The default binding for this signal is Control-L.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitLocationTogglePopup
public void emitLocationTogglePopup()Deprecated.Emits the "location-toggle-popup" signal. SeeonLocationTogglePopup(FileChooserWidget.LocationTogglePopupCallback). -
onPlacesShortcut
public SignalConnection<FileChooserWidget.PlacesShortcutCallback> onPlacesShortcut(FileChooserWidget.PlacesShortcutCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to move the focus to the places sidebar.
The default binding for this signal is Alt-P.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitPlacesShortcut
public void emitPlacesShortcut()Deprecated.Emits the "places-shortcut" signal. SeeonPlacesShortcut(FileChooserWidget.PlacesShortcutCallback). -
onQuickBookmark
public SignalConnection<FileChooserWidget.QuickBookmarkCallback> onQuickBookmark(FileChooserWidget.QuickBookmarkCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser switch to the bookmark specified in the
bookmarkIndexparameter. For example, if you have three bookmarks, you can pass 0, 1, 2 to this signal to switch to each of them, respectively.The default binding for this signal is Alt-1, Alt-2, etc. until Alt-0. Note that in the default binding, that Alt-1 is actually defined to switch to the bookmark at index 0, and so on successively.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitQuickBookmark
public void emitQuickBookmark(int bookmarkIndex) Deprecated.Emits the "quick-bookmark" signal. SeeonQuickBookmark(FileChooserWidget.QuickBookmarkCallback). -
onRecentShortcut
public SignalConnection<FileChooserWidget.RecentShortcutCallback> onRecentShortcut(FileChooserWidget.RecentShortcutCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the Recent location.
The default binding for this signal is Alt-R.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitRecentShortcut
public void emitRecentShortcut()Deprecated.Emits the "recent-shortcut" signal. SeeonRecentShortcut(FileChooserWidget.RecentShortcutCallback). -
onSearchShortcut
public SignalConnection<FileChooserWidget.SearchShortcutCallback> onSearchShortcut(FileChooserWidget.SearchShortcutCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser show the search entry.
The default binding for this signal is Alt-S.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitSearchShortcut
public void emitSearchShortcut()Deprecated.Emits the "search-shortcut" signal. SeeonSearchShortcut(FileChooserWidget.SearchShortcutCallback). -
onShowHidden
public SignalConnection<FileChooserWidget.ShowHiddenCallback> onShowHidden(FileChooserWidget.ShowHiddenCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser display hidden files.
The default binding for this signal is Control-H.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitShowHidden
public void emitShowHidden()Deprecated.Emits the "show-hidden" signal. SeeonShowHidden(FileChooserWidget.ShowHiddenCallback). -
onUpFolder
public SignalConnection<FileChooserWidget.UpFolderCallback> onUpFolder(FileChooserWidget.UpFolderCallback handler) Deprecated.Emitted when the user asks for it.
This is a keybinding signal.
This is used to make the file chooser go to the parent of the current folder in the file hierarchy.
The default binding for this signal is Alt-Up.
- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitUpFolder
public void emitUpFolder()Deprecated.Emits the "up-folder" signal. SeeonUpFolder(FileChooserWidget.UpFolderCallback). -
builder
Deprecated.AFileChooserWidget.Builderobject constructs aFileChooserWidgetwith the specified properties. Use the variousset...()methods to set properties, and finish construction withFileChooserWidget.Builder.build().- Returns:
- the builder object
-
GtkFileChooserWidgetis deprecated