Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The GtkAppChooserButton
lets the user select an application.
Initially, a GtkAppChooserButton
selects the first application
in its list, which will either be the most-recently used application
or, if AppChooserButton:showDefaultItem is True
, the
default application.
The list of applications shown in a GtkAppChooserButton
includes
the recommended applications for the given content type. When
AppChooserButton:showDefaultItem is set, the default
application is also included. To let the user chooser other applications,
you can set the AppChooserButton:showDialogItem property,
which allows to open a full AppChooserDialog
.
It is possible to add custom items to the list, using
appChooserButtonAppendCustomItem
. These items cause
the AppChooserButton::customItemActivated signal to be
emitted when they are selected.
To track changes in the selected application, use the AppChooserButton::changed signal.
CSS nodes
GtkAppChooserButton
has a single CSS node with the name “appchooserbutton”.
Synopsis
- newtype AppChooserButton = AppChooserButton (ManagedPtr AppChooserButton)
- class (GObject o, IsDescendantOf AppChooserButton o) => IsAppChooserButton o
- toAppChooserButton :: (MonadIO m, IsAppChooserButton o) => o -> m AppChooserButton
- appChooserButtonAppendCustomItem :: (HasCallStack, MonadIO m, IsAppChooserButton a, IsIcon b) => a -> Text -> Text -> b -> m ()
- appChooserButtonAppendSeparator :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> m ()
- appChooserButtonGetHeading :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> m (Maybe Text)
- appChooserButtonGetModal :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> m Bool
- appChooserButtonGetShowDefaultItem :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> m Bool
- appChooserButtonGetShowDialogItem :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> m Bool
- appChooserButtonNew :: (HasCallStack, MonadIO m) => Text -> m AppChooserButton
- appChooserButtonSetActiveCustomItem :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> Text -> m ()
- appChooserButtonSetHeading :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> Text -> m ()
- appChooserButtonSetModal :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> Bool -> m ()
- appChooserButtonSetShowDefaultItem :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> Bool -> m ()
- appChooserButtonSetShowDialogItem :: (HasCallStack, MonadIO m, IsAppChooserButton a) => a -> Bool -> m ()
- constructAppChooserButtonHeading :: (IsAppChooserButton o, MonadIO m) => Text -> m (GValueConstruct o)
- getAppChooserButtonHeading :: (MonadIO m, IsAppChooserButton o) => o -> m (Maybe Text)
- setAppChooserButtonHeading :: (MonadIO m, IsAppChooserButton o) => o -> Text -> m ()
- constructAppChooserButtonModal :: (IsAppChooserButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppChooserButtonModal :: (MonadIO m, IsAppChooserButton o) => o -> m Bool
- setAppChooserButtonModal :: (MonadIO m, IsAppChooserButton o) => o -> Bool -> m ()
- constructAppChooserButtonShowDefaultItem :: (IsAppChooserButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppChooserButtonShowDefaultItem :: (MonadIO m, IsAppChooserButton o) => o -> m Bool
- setAppChooserButtonShowDefaultItem :: (MonadIO m, IsAppChooserButton o) => o -> Bool -> m ()
- constructAppChooserButtonShowDialogItem :: (IsAppChooserButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getAppChooserButtonShowDialogItem :: (MonadIO m, IsAppChooserButton o) => o -> m Bool
- setAppChooserButtonShowDialogItem :: (MonadIO m, IsAppChooserButton o) => o -> Bool -> m ()
- type AppChooserButtonActivateCallback = IO ()
- afterAppChooserButtonActivate :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonActivateCallback) -> m SignalHandlerId
- onAppChooserButtonActivate :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonActivateCallback) -> m SignalHandlerId
- type AppChooserButtonChangedCallback = IO ()
- afterAppChooserButtonChanged :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonChangedCallback) -> m SignalHandlerId
- onAppChooserButtonChanged :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonChangedCallback) -> m SignalHandlerId
- type AppChooserButtonCustomItemActivatedCallback = Text -> IO ()
- afterAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => AppChooserButtonCustomItemActivatedCallback) -> m SignalHandlerId
- onAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => AppChooserButtonCustomItemActivatedCallback) -> m SignalHandlerId
Exported types
newtype AppChooserButton Source #
Memory-managed wrapper type.
AppChooserButton (ManagedPtr AppChooserButton) |
Instances
class (GObject o, IsDescendantOf AppChooserButton o) => IsAppChooserButton o Source #
Type class for types which can be safely cast to AppChooserButton
, for instance with toAppChooserButton
.
Instances
(GObject o, IsDescendantOf AppChooserButton o) => IsAppChooserButton o Source # | |
Defined in GI.Gtk.Objects.AppChooserButton |
toAppChooserButton :: (MonadIO m, IsAppChooserButton o) => o -> m AppChooserButton Source #
Cast to AppChooserButton
, 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
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, appendCustomItem, appendSeparator, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, refresh, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAppInfo, getAtContext, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getContentType, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeading, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getModal, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getShowDefaultItem, getShowDialogItem, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setActiveCustomItem, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHeading, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setModal, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setShowDefaultItem, setShowDialogItem, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
appendCustomItem
appChooserButtonAppendCustomItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a, IsIcon b) | |
=> a |
|
-> Text |
|
-> Text |
|
-> b |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Appends a custom item to the list of applications that is shown in the popup.
The item name must be unique per-widget. Clients can use the provided name as a detail for the AppChooserButton::customItemActivated signal, to add a callback for the activation of a particular custom item in the list.
See also appChooserButtonAppendSeparator
.
appendSeparator
appChooserButtonAppendSeparator Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Appends a separator to the list of applications that is shown in the popup.
getHeading
appChooserButtonGetHeading Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m (Maybe Text) | Returns: the text to display at the top of the dialog,
or |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Returns the text to display at the top of the dialog.
getModal
appChooserButtonGetModal Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Gets whether the dialog is modal.
getShowDefaultItem
appChooserButtonGetShowDefaultItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m Bool | Returns: the value of AppChooserButton:showDefaultItem |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Returns whether the dropdown menu should show the default application at the top.
getShowDialogItem
appChooserButtonGetShowDialogItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m Bool | Returns: the value of AppChooserButton:showDialogItem |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Returns whether the dropdown menu shows an item
for a GtkAppChooserDialog
.
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m AppChooserButton | Returns: a newly created |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Creates a new GtkAppChooserButton
for applications
that can handle content of the given type.
setActiveCustomItem
appChooserButtonSetActiveCustomItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Selects a custom item.
See appChooserButtonAppendCustomItem
.
Use appChooserRefresh
to bring the selection
to its initial state.
setHeading
appChooserButtonSetHeading Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Sets the text to display at the top of the dialog.
If the heading is not set, the dialog displays a default text.
setModal
appChooserButtonSetModal Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Sets whether the dialog should be modal.
setShowDefaultItem
appChooserButtonSetShowDefaultItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Sets whether the dropdown menu of this button should show the default application for the given content type at top.
setShowDialogItem
appChooserButtonSetShowDialogItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 4.10)This widget will be removed in GTK 5
Sets whether the dropdown menu of this button should show an
entry to trigger a GtkAppChooserDialog
.
Properties
heading
The text to show at the top of the dialog that can be opened from the button.
The string may contain Pango markup.
constructAppChooserButtonHeading :: (IsAppChooserButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “heading
” property. This is rarely needed directly, but it is used by new
.
getAppChooserButtonHeading :: (MonadIO m, IsAppChooserButton o) => o -> m (Maybe Text) Source #
Get the value of the “heading
” property.
When overloading is enabled, this is equivalent to
get
appChooserButton #heading
setAppChooserButtonHeading :: (MonadIO m, IsAppChooserButton o) => o -> Text -> m () Source #
Set the value of the “heading
” property.
When overloading is enabled, this is equivalent to
set
appChooserButton [ #heading:=
value ]
modal
Whether the app chooser dialog should be modal.
constructAppChooserButtonModal :: (IsAppChooserButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “modal
” property. This is rarely needed directly, but it is used by new
.
getAppChooserButtonModal :: (MonadIO m, IsAppChooserButton o) => o -> m Bool Source #
Get the value of the “modal
” property.
When overloading is enabled, this is equivalent to
get
appChooserButton #modal
setAppChooserButtonModal :: (MonadIO m, IsAppChooserButton o) => o -> Bool -> m () Source #
Set the value of the “modal
” property.
When overloading is enabled, this is equivalent to
set
appChooserButton [ #modal:=
value ]
showDefaultItem
Determines whether the dropdown menu shows the default application on top for the provided content type.
constructAppChooserButtonShowDefaultItem :: (IsAppChooserButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “show-default-item
” property. This is rarely needed directly, but it is used by new
.
getAppChooserButtonShowDefaultItem :: (MonadIO m, IsAppChooserButton o) => o -> m Bool Source #
Get the value of the “show-default-item
” property.
When overloading is enabled, this is equivalent to
get
appChooserButton #showDefaultItem
setAppChooserButtonShowDefaultItem :: (MonadIO m, IsAppChooserButton o) => o -> Bool -> m () Source #
Set the value of the “show-default-item
” property.
When overloading is enabled, this is equivalent to
set
appChooserButton [ #showDefaultItem:=
value ]
showDialogItem
Determines whether the dropdown menu shows an item to open
a GtkAppChooserDialog
.
constructAppChooserButtonShowDialogItem :: (IsAppChooserButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “show-dialog-item
” property. This is rarely needed directly, but it is used by new
.
getAppChooserButtonShowDialogItem :: (MonadIO m, IsAppChooserButton o) => o -> m Bool Source #
Get the value of the “show-dialog-item
” property.
When overloading is enabled, this is equivalent to
get
appChooserButton #showDialogItem
setAppChooserButtonShowDialogItem :: (MonadIO m, IsAppChooserButton o) => o -> Bool -> m () Source #
Set the value of the “show-dialog-item
” property.
When overloading is enabled, this is equivalent to
set
appChooserButton [ #showDialogItem:=
value ]
Signals
activate
type AppChooserButtonActivateCallback = IO () Source #
Emitted to when the button is activated.
The ::activate
signal on GtkAppChooserButton
is an action signal and
emitting it causes the button to pop up its dialog.
Since: 4.4
afterAppChooserButtonActivate :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonActivateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the activate signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appChooserButton #activate 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.
onAppChooserButtonActivate :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonActivateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the activate signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appChooserButton #activate callback
changed
type AppChooserButtonChangedCallback = IO () Source #
Emitted when the active application changes.
afterAppChooserButtonChanged :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appChooserButton #changed 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.
onAppChooserButtonChanged :: (IsAppChooserButton a, MonadIO m) => a -> ((?self :: a) => AppChooserButtonChangedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the changed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appChooserButton #changed callback
customItemActivated
type AppChooserButtonCustomItemActivatedCallback Source #
Emitted when a custom item is activated.
Use appChooserButtonAppendCustomItem
,
to add custom items.
afterAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => AppChooserButtonCustomItemActivatedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the customItemActivated signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
appChooserButton #customItemActivated callback
This signal admits a optional parameter detail
.
If it's not Nothing
, we will connect to “custom-item-activated::detail
” instead.
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.
onAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => AppChooserButtonCustomItemActivatedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the customItemActivated signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
appChooserButton #customItemActivated callback
This signal admits a optional parameter detail
.
If it's not Nothing
, we will connect to “custom-item-activated::detail
” instead.