GtkFileChooserButton: GtkFileChooserButton

Description Methods and Functions Hierarchy Interfaces Detailed Description Structures Convenient Construction Signals Properties Author(s) References See Also

Description

A button to launch a file selection dialog

Methods and Functions

gtkFileChooserButtonNew(title, action, show = TRUE)
gtkFileChooserButtonNewWithBackend(title, action, backend, show = TRUE)
gtkFileChooserButtonNewWithBackend(title, action, backend, show = TRUE)
gtkFileChooserButtonNewWithDialog(dialog)
gtkFileChooserButtonGetTitle(object)
gtkFileChooserButtonSetTitle(object, title)
gtkFileChooserButtonGetWidthChars(object)
gtkFileChooserButtonSetWidthChars(object, n.chars)
gtkFileChooserButtonGetFocusOnClick(object)
gtkFileChooserButtonSetFocusOnClick(object, focus.on.click)
gtkFileChooserButton(title, action, backend, show = TRUE)

Hierarchy

1
2
3
4
5
6
7
8
GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkHBox
                                       +----GtkFileChooserButton

Interfaces

GtkFileChooserButton implements AtkImplementorIface, GtkBuildable, GtkOrientable and GtkFileChooser.

Detailed Description

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.

Create a button to let the user select a file in /etc

1
2
3
# Create a button to let the user select a file in /etc
button <- gtkFileChooserButton("Select a file", "open")
button$setCurrentFolder("/etc")

The GtkFileChooserButton supports the GtkFileChooserActions GTK_FILE_CHOOSER_ACTION_OPEN and GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER. PLEASE NOTE: The GtkFileChooserButton will ellipsize the label, and thus will thus request little horizontal space. To give the button more space, you should call gtkWidgetSizeRequest, gtkFileChooserButtonSetWidthChars, or pack the button in such a way that other interface elements give space to the widget.

Structures

GtkFileChooserButton

This should not be accessed directly. Use the accessor functions below.

Convenient Construction

gtkFileChooserButton is the result of collapsing the constructors of GtkFileChooserButton (gtkFileChooserButtonNew, gtkFileChooserButtonNewWithBackend) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.

Signals

file-set(widget, user.data)

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. Since 2.12

widget

the object which received the signal.

user.data

user data set when the signal handler was connected.

Properties

dialog [GtkFileChooser : * : Write / Construct Only]

Instance of the GtkFileChooserDialog associated with the button. Since 2.6

focus-on-click [logical : Read / Write]

Whether the GtkFileChooserButton button grabs focus when it is clicked with the mouse. Default value: TRUE Since 2.10

title [character : * : Read / Write]

Title to put on the GtkFileChooserDialog associated with the button. Default value: "Select A File" Since 2.6

width-chars [integer : Read / Write]

The width of the entry and label inside the button, in characters. Allowed values: >= -1 Default value: -1 Since 2.6

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gtk2/stable/GtkFileChooserButton.html

See Also

GtkFileChooserDialog


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.