Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
The AppChooserButton
is a widget that lets the user select
an application. It implements the AppChooser
interface.
Initially, a AppChooserButton
selects the first application
in its list, which will either be the most-recently used application
or, if AppChooserButton
:show-default-item
is True
, the
default application.
The list of applications shown in a AppChooserButton
includes
the recommended applications for the given content type. When
AppChooserButton
:show-default-item
is set, the default application
is also included. To let the user chooser other applications,
you can set the AppChooserButton
:show-dialog-item
property,
which allows to open a full AppChooserDialog
.
It is possible to add custom items to the list, using
appChooserButtonAppendCustomItem
. These items cause
the customItemActivated signal to be
emitted when they are selected.
To track changes in the selected application, use the changed signal.
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)
- 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 ()
- 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 ()
- 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 AppChooserButtonCustomItemActivatedCallback = Text -> IO ()
- type C_AppChooserButtonCustomItemActivatedCallback = Ptr () -> CString -> Ptr () -> IO ()
- afterAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> AppChooserButtonCustomItemActivatedCallback -> m SignalHandlerId
- genClosure_AppChooserButtonCustomItemActivated :: MonadIO m => AppChooserButtonCustomItemActivatedCallback -> m (GClosure C_AppChooserButtonCustomItemActivatedCallback)
- mk_AppChooserButtonCustomItemActivatedCallback :: C_AppChooserButtonCustomItemActivatedCallback -> IO (FunPtr C_AppChooserButtonCustomItemActivatedCallback)
- noAppChooserButtonCustomItemActivatedCallback :: Maybe AppChooserButtonCustomItemActivatedCallback
- onAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> AppChooserButtonCustomItemActivatedCallback -> m SignalHandlerId
- wrap_AppChooserButtonCustomItemActivatedCallback :: AppChooserButtonCustomItemActivatedCallback -> C_AppChooserButtonCustomItemActivatedCallback
Exported types
newtype AppChooserButton Source #
Memory-managed wrapper type.
Instances
Eq AppChooserButton Source # | |
Defined in GI.Gtk.Objects.AppChooserButton (==) :: AppChooserButton -> AppChooserButton -> Bool # (/=) :: AppChooserButton -> AppChooserButton -> Bool # | |
IsGValue AppChooserButton Source # | Convert |
Defined in GI.Gtk.Objects.AppChooserButton toGValue :: AppChooserButton -> IO GValue # fromGValue :: GValue -> IO AppChooserButton # | |
ManagedPtrNewtype AppChooserButton Source # | |
Defined in GI.Gtk.Objects.AppChooserButton | |
TypedObject AppChooserButton Source # | |
Defined in GI.Gtk.Objects.AppChooserButton | |
GObject AppChooserButton Source # | |
Defined in GI.Gtk.Objects.AppChooserButton | |
HasParentTypes AppChooserButton Source # | |
Defined in GI.Gtk.Objects.AppChooserButton | |
type ParentTypes AppChooserButton Source # | |
Defined in GI.Gtk.Objects.AppChooserButton type ParentTypes AppChooserButton = '[ComboBox, Bin, Container, Widget, Object, ImplementorIface, AppChooser, Buildable, CellEditable, CellLayout] |
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
Overloaded methods
appendCustomItem
appChooserButtonAppendCustomItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a, IsIcon b) | |
=> a |
|
-> Text |
|
-> Text |
|
-> b |
|
-> m () |
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
customItemActivated signal, to add a
callback for the activation of a particular custom item in the list.
See also appChooserButtonAppendSeparator
.
Since: 3.0
appendSeparator
appChooserButtonAppendSeparator Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m () |
Appends a separator to the list of applications that is shown in the popup.
Since: 3.0
getHeading
appChooserButtonGetHeading Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m (Maybe Text) | Returns: the text to display at the top of the dialog,
or |
Returns the text to display at the top of the dialog.
getShowDefaultItem
appChooserButtonGetShowDefaultItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m Bool | Returns: the value of |
Returns the current value of the AppChooserButton
:show-default-item
property.
Since: 3.2
getShowDialogItem
appChooserButtonGetShowDialogItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> m Bool | Returns: the value of |
Returns the current value of the AppChooserButton
:show-dialog-item
property.
Since: 3.0
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m AppChooserButton | Returns: a newly created |
Creates a new AppChooserButton
for applications
that can handle content of the given type.
Since: 3.0
setActiveCustomItem
appChooserButtonSetActiveCustomItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Text |
|
-> m () |
Selects a custom item previously added with
appChooserButtonAppendCustomItem
.
Use appChooserRefresh
to bring the selection
to its initial state.
Since: 3.0
setHeading
appChooserButtonSetHeading Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the text to display at the top of the dialog. If the heading is not set, the dialog displays a default text.
setShowDefaultItem
appChooserButtonSetShowDefaultItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the dropdown menu of this button should show the default application for the given content type at top.
Since: 3.2
setShowDialogItem
appChooserButtonSetShowDialogItem Source #
:: (HasCallStack, MonadIO m, IsAppChooserButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the dropdown menu of this button should show an
entry to trigger a AppChooserDialog
.
Since: 3.0
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 ]
showDefaultItem
The AppChooserButton
:show-default-item
property determines
whether the dropdown menu should show the default application
on top for the provided content type.
Since: 3.2
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
The AppChooserButton
:show-dialog-item
property determines
whether the dropdown menu should show an item that triggers
a AppChooserDialog
when clicked.
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
customItemActivated
type AppChooserButtonCustomItemActivatedCallback Source #
= Text |
|
-> IO () |
Emitted when a custom item, previously added with
appChooserButtonAppendCustomItem
, is activated from the
dropdown menu.
type C_AppChooserButtonCustomItemActivatedCallback = Ptr () -> CString -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
afterAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> 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.
genClosure_AppChooserButtonCustomItemActivated :: MonadIO m => AppChooserButtonCustomItemActivatedCallback -> m (GClosure C_AppChooserButtonCustomItemActivatedCallback) Source #
Wrap the callback into a GClosure
.
mk_AppChooserButtonCustomItemActivatedCallback :: C_AppChooserButtonCustomItemActivatedCallback -> IO (FunPtr C_AppChooserButtonCustomItemActivatedCallback) Source #
Generate a function pointer callable from C code, from a C_AppChooserButtonCustomItemActivatedCallback
.
noAppChooserButtonCustomItemActivatedCallback :: Maybe AppChooserButtonCustomItemActivatedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
AppChooserButtonCustomItemActivatedCallback
onAppChooserButtonCustomItemActivated :: (IsAppChooserButton a, MonadIO m) => a -> Maybe Text -> 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.