gi-gtk3-3.0.44: Gtk 3.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.FileChooserButton

Contents

- Exported types
- Methods
  - getFocusOnClick
  - getTitle
  - getWidthChars
  - new
  - newWithDialog
  - setFocusOnClick
  - setTitle
  - setWidthChars
- Properties
  - dialog
  - title
  - widthChars
- Signals
  - fileSet

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:selectMultiple 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 t'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.

# CSS nodes

GtkFileChooserButton has a CSS node with name “filechooserbutton”, containing a subnode for the internal button with name “button” and style class “.file”.

Synopsis

- newtype FileChooserButton = FileChooserButton (ManagedPtr FileChooserButton)
- class (GObject o, IsDescendantOf FileChooserButton o) => IsFileChooserButton o
- toFileChooserButton :: (MonadIO m, IsFileChooserButton o) => o -> m FileChooserButton
- fileChooserButtonGetFocusOnClick :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> m Bool
- fileChooserButtonGetTitle :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> m Text
- fileChooserButtonGetWidthChars :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> m Int32
- fileChooserButtonNew :: (HasCallStack, MonadIO m) => Text -> FileChooserAction -> m FileChooserButton
- fileChooserButtonNewWithDialog :: (HasCallStack, MonadIO m, IsDialog a) => a -> m FileChooserButton
- fileChooserButtonSetFocusOnClick :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> Bool -> m ()
- fileChooserButtonSetTitle :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> Text -> m ()
- fileChooserButtonSetWidthChars :: (HasCallStack, MonadIO m, IsFileChooserButton a) => a -> Int32 -> m ()
- constructFileChooserButtonDialog :: (IsFileChooserButton o, MonadIO m, IsFileChooser a) => a -> m (GValueConstruct o)
- constructFileChooserButtonTitle :: (IsFileChooserButton o, MonadIO m) => Text -> m (GValueConstruct o)
- getFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> m Text
- setFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> Text -> m ()
- constructFileChooserButtonWidthChars :: (IsFileChooserButton o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> m Int32
- setFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> Int32 -> m ()
- type FileChooserButtonFileSetCallback = IO ()
- afterFileChooserButtonFileSet :: (IsFileChooserButton a, MonadIO m) => a -> ((?self :: a) => FileChooserButtonFileSetCallback) -> m SignalHandlerId
- onFileChooserButtonFileSet :: (IsFileChooserButton a, MonadIO m) => a -> ((?self :: a) => FileChooserButtonFileSetCallback) -> m SignalHandlerId

# Exported types

newtype FileChooserButton Source #

Memory-managed wrapper type.

Constructors

FileChooserButton (ManagedPtr FileChooserButton) |

#### Instances

Instances details

Eq FileChooserButton Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton Methods (==) :: FileChooserButton -> FileChooserButton -> Bool Source # (/=) :: FileChooserButton -> FileChooserButton -> Bool Source #
GObject FileChooserButton Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton
ManagedPtrNewtype FileChooserButton Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton Methods toManagedPtr :: FileChooserButton -> ManagedPtr FileChooserButton Source #
TypedObject FileChooserButton Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton Methods glibType :: IO GType Source #
HasParentTypes FileChooserButton Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton
IsGValue (Maybe FileChooserButton) Source # | Convert `FileChooserButton` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.FileChooserButton Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe FileChooserButton -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe FileChooserButton) Source #
type ParentTypes FileChooserButton Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton type ParentTypes FileChooserButton = '[Box, Container, Widget, Object, ImplementorIface, Buildable, FileChooser, Orientable]

class (GObject o, IsDescendantOf FileChooserButton o) => IsFileChooserButton o Source #

Type class for types which can be safely cast to `FileChooserButton`, for instance with `toFileChooserButton`.

#### Instances

Instances details

(GObject o, IsDescendantOf FileChooserButton o) => IsFileChooserButton o Source # |
Instance details Defined in GI.Gtk.Objects.FileChooserButton

toFileChooserButton :: (MonadIO m, IsFileChooserButton o) => o -> m FileChooserButton Source #

Cast to `FileChooserButton`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

activate, add, addAccelerator, addChild, addChoice, addDeviceEvents, addEvents, addFilter, addMnemonicLabel, addShortcutFolder, addShortcutFolderUri, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listFilters, listMnemonicLabels, listShortcutFolderUris, listShortcutFolders, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, packEnd, packStart, parserFinished, path, propagateDraw, queryChildPacking, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeChoice, removeFilter, removeMnemonicLabel, removeShortcutFolder, removeShortcutFolderUri, removeTickCallback, renderIcon, renderIconPixbuf, reorderChild, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, selectAll, selectFile, selectFilename, selectUri, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unselectAll, unselectFile, unselectFilename, unselectUri, unsetFocusChain, unsetStateFlags, watchClosure.

#### Getters

getAccessible, getAction, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBaselinePosition, getBorderWidth, getCanDefault, getCanFocus, getCenterWidget, getChildRequisition, getChildVisible, getChildren, getChoice, getClip, getClipboard, getCompositeName, getCreateFolders, getCurrentFolder, getCurrentFolderFile, getCurrentFolderUri, getCurrentName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoOverwriteConfirmation, getDoubleBuffered, getEvents, getExtraWidget, getFile, getFilename, getFilenames, getFiles, getFilter, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getHomogeneous, getInternalChild, getLocalOnly, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getOrientation, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getPreviewFile, getPreviewFilename, getPreviewUri, getPreviewWidget, getPreviewWidgetActive, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getResizeMode, getRootWindow, getScaleFactor, getScreen, getSelectMultiple, getSensitive, getSettings, getShowHidden, getSizeRequest, getSpacing, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTitle, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUri, getUris, getUsePreviewLabel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWidthChars, getWindow.

#### Setters

setAccelPath, setAction, setAllocation, setAppPaintable, setBaselinePosition, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setCenterWidget, setChildPacking, setChildVisible, setChoice, setClip, setCompositeName, setCreateFolders, setCurrentFolder, setCurrentFolderFile, setCurrentFolderUri, setCurrentName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoOverwriteConfirmation, setDoubleBuffered, setEvents, setExtraWidget, setFile, setFilename, setFilter, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setHomogeneous, setLocalOnly, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setOrientation, setParent, setParentWindow, setPreviewWidget, setPreviewWidgetActive, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setResizeMode, setSelectMultiple, setSensitive, setShowHidden, setSizeRequest, setSpacing, setState, setStateFlags, setStyle, setSupportMultidevice, setTitle, setTooltipMarkup, setTooltipText, setTooltipWindow, setUri, setUsePreviewLabel, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWidthChars, setWindow.

## 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

Instance of the `FileChooserDialog` associated with the button.

Since: 2.6

constructFileChooserButtonDialog :: (IsFileChooserButton o, MonadIO m, IsFileChooser a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`dialog`” property. This is rarely needed directly, but it is used by `new`.

## title

Title to put on the `FileChooserDialog` associated with the button.

Since: 2.6

constructFileChooserButtonTitle :: (IsFileChooserButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`title`” property. This is rarely needed directly, but it is used by `new`.

getFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> m Text Source #

Get the value of the “`title`” property. When overloading is enabled, this is equivalent to

    get fileChooserButton #title

setFileChooserButtonTitle :: (MonadIO m, IsFileChooserButton o) => o -> Text -> m () Source #

Set the value of the “`title`” property. When overloading is enabled, this is equivalent to

    set fileChooserButton [ #title := value ]

## widthChars

The width of the entry and label inside the button, in characters.

Since: 2.6

constructFileChooserButtonWidthChars :: (IsFileChooserButton o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`width-chars`” property. This is rarely needed directly, but it is used by `new`.

getFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> m Int32 Source #

Get the value of the “`width-chars`” property. When overloading is enabled, this is equivalent to

    get fileChooserButton #widthChars

setFileChooserButtonWidthChars :: (MonadIO m, IsFileChooserButton o) => o -> Int32 -> m () Source #

Set the value of the “`width-chars`” property. When overloading is enabled, this is equivalent to

    set fileChooserButton [ #widthChars := value ]

# Signals

## fileSet

type FileChooserButtonFileSetCallback = IO () Source #

The fileSet 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

afterFileChooserButtonFileSet :: (IsFileChooserButton a, MonadIO m) => a -> ((?self :: a) => FileChooserButtonFileSetCallback) -> m SignalHandlerId Source #

Connect a signal handler for the fileSet signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after fileChooserButton #fileSet callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onFileChooserButtonFileSet :: (IsFileChooserButton a, MonadIO m) => a -> ((?self :: a) => FileChooserButtonFileSetCallback) -> m SignalHandlerId Source #

Connect a signal handler for the fileSet signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on fileChooserButton #fileSet callback