gi-gtk-3.0.17: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.FileChooserButton

Contents

Description

The FileChooserButton is a widget that lets the user select a file. It implements the FileChooser interface. Visually, it is a file name with a button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated with that button. This widget does not support setting the FileChooser:select-multiple property to True.

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

C code

{
  GtkWidget *button;

  button = gtk_file_chooser_button_new (_("Select a file"),
                                        GTK_FILE_CHOOSER_ACTION_OPEN);
  gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
                                       "/etc");
}

The FileChooserButton supports the GtkFileChooserActions FileChooserActionOpen and FileChooserActionSelectFolder.

The 'GI.Gtk.Objects.FileChooserButton.FileChooserButton' will ellipsize the label, and will thus
request little horizontal space.  To give the button more space,
you should call 'GI.Gtk.Objects.Widget.widgetGetPreferredSize',
'GI.Gtk.Objects.FileChooserButton.fileChooserButtonSetWidthChars', or pack the button in
such a way that other interface elements give space to the
widget.

Synopsis

Exported types

Methods

getFocusOnClick

fileChooserButtonGetFocusOnClick Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileChooserButton a) 
=> a

button: a FileChooserButton

-> m Bool

Returns: True if the button grabs focus when it is clicked with the mouse.

Deprecated: (Since version 3.20)Use widgetGetFocusOnClick instead

Returns whether the button grabs focus when it is clicked with the mouse. See fileChooserButtonSetFocusOnClick.

Since: 2.10

getTitle

fileChooserButtonGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileChooserButton a) 
=> a

button: the button widget to examine.

-> m Text

Returns: a pointer to the browse dialog’s title.

Retrieves the title of the browse dialog used by button. The returned value should not be modified or freed.

Since: 2.6

getWidthChars

fileChooserButtonGetWidthChars Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileChooserButton a) 
=> a

button: the button widget to examine.

-> m Int32

Returns: an integer width (in characters) that the button will use to size itself.

Retrieves the width in characters of the button widget’s entry and/or label.

Since: 2.6

new

fileChooserButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

title: the title of the browse dialog.

-> FileChooserAction

action: the open mode for the widget.

-> m FileChooserButton

Returns: a new button widget.

Creates a new file-selecting button widget.

Since: 2.6

newWithDialog

fileChooserButtonNewWithDialog Source #

Arguments

:: (HasCallStack, MonadIO m, IsDialog a) 
=> a

dialog: the widget to use as dialog

-> m FileChooserButton

Returns: a new button widget.

Creates a FileChooserButton widget which uses dialog as its file-picking window.

Note that dialog must be a Dialog (or subclass) which implements the FileChooser interface and must not have DialogFlagsDestroyWithParent set.

Also note that the dialog needs to have its confirmative button added with response ResponseTypeAccept or ResponseTypeOk in order for the button to take over the file selected in the dialog.

Since: 2.6

setFocusOnClick

fileChooserButtonSetFocusOnClick Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileChooserButton a) 
=> a

button: a FileChooserButton

-> Bool

focusOnClick: whether the button grabs focus when clicked with the mouse

-> m () 

Deprecated: (Since version 3.20)Use widgetSetFocusOnClick instead

Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

Since: 2.10

setTitle

fileChooserButtonSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileChooserButton a) 
=> a

button: the button widget to modify.

-> Text

title: the new browse dialog title.

-> m () 

Modifies the title of the browse dialog used by button.

Since: 2.6

setWidthChars

fileChooserButtonSetWidthChars Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileChooserButton a) 
=> a

button: the button widget to examine.

-> Int32

nChars: the new width, in characters.

-> m () 

Sets the width (in characters) that button will use to nChars.

Since: 2.6

Properties

dialog

title

widthChars

Signals

fileSet