Package: gtk

Class gtk-file-chooser-button

Superclasses

gtk-box, gtk-container, gtk-widget, gtk-buildable, gtk-orientable, gtk-file-chooser, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

dialog
The dialog property of type gtk-file-chooser (Write / Construct Only)
Instance of the file chooser dialog associated with the button.
focus-on-click
The focus-on-click property of type :boolean (Read / Write)
Whether the file chooser button grabs focus when it is clicked with the mouse.
Default value: true
title
The title property of type :string (Read / Write)
Title to put on the file chooser dialog associated with the button.
Default value: "Select a File"
width-chars
The width-chars property of type :int (Read / Write)
The width of the entry and label inside the button, in characters.
Allowed values: >= -1
Default value: -1

Details

The gtk-file-chooser-button widget is a widget that lets the user select a file.



It implements the gtk-file-chooser interface. Visually, it is a file name with a button to bring up a gtk-file-chooser-dialog widget. 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.

The gtk-file-chooser-button widget supports the gtk-file-chooser-action's :open and :select-folder.

Example

Create a button to let the user select a file.
(let ((button (gtk-file-chooser-button-new "Select a file" :open)))
  (setf (gtk-file-chooser-current-folder button) "/etc")
  ... )    

Note

The gtk-file-chooser-button widget will ellipsize the label, and thus will request little horizontal space. To give the button more space, you should call the functions gtk-widget-preferred-size, gtk-file-chooser-button-width-chars, or pack the button in such a way that other interface elements give space to the widget.

CSS nodes

The gtk-file-chooser-button implementation has a CSS node with name filechooserbutton, containing a subnode for the internal button with name button and .file style class.

Signal Details

The "file-set" signal
 lambda (widget)    : Run First      
The "file-set" signal is emitted when the user selects a file. Note that this signal is only emitted when the user changes the file.
widget
The gtk-file-chooser-button widget which received the signal.
 

Slot Access Functions

Inherited Slot Access Functions

See also

*2021-2-5