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 |
One item of a ContextMenu
.
The ContextMenu
is composed of ContextMenuItem
s. These items can be created from a GtkAction
, from a
ContextMenuAction
or from a ContextMenuAction
and a
label. These ContextMenuAction
s denote stock actions
for the items. You can also create separators and submenus.
Synopsis
- newtype ContextMenuItem = ContextMenuItem (ManagedPtr ContextMenuItem)
- class (GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o
- toContextMenuItem :: (MonadIO m, IsContextMenuItem o) => o -> m ContextMenuItem
- contextMenuItemGetGaction :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m Action
- contextMenuItemGetStockAction :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m ContextMenuAction
- contextMenuItemGetSubmenu :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m ContextMenu
- contextMenuItemIsSeparator :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m Bool
- contextMenuItemNewFromGaction :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> Maybe GVariant -> m ContextMenuItem
- contextMenuItemNewFromStockAction :: (HasCallStack, MonadIO m) => ContextMenuAction -> m ContextMenuItem
- contextMenuItemNewFromStockActionWithLabel :: (HasCallStack, MonadIO m) => ContextMenuAction -> Text -> m ContextMenuItem
- contextMenuItemNewSeparator :: (HasCallStack, MonadIO m) => m ContextMenuItem
- contextMenuItemNewWithSubmenu :: (HasCallStack, MonadIO m, IsContextMenu a) => Text -> a -> m ContextMenuItem
- contextMenuItemSetSubmenu :: (HasCallStack, MonadIO m, IsContextMenuItem a, IsContextMenu b) => a -> Maybe b -> m ()
Exported types
newtype ContextMenuItem Source #
Memory-managed wrapper type.
ContextMenuItem (ManagedPtr ContextMenuItem) |
Instances
Eq ContextMenuItem Source # | |
Defined in GI.WebKitWebProcessExtension.Objects.ContextMenuItem (==) :: ContextMenuItem -> ContextMenuItem -> Bool # (/=) :: ContextMenuItem -> ContextMenuItem -> Bool # | |
GObject ContextMenuItem Source # | |
ManagedPtrNewtype ContextMenuItem Source # | |
Defined in GI.WebKitWebProcessExtension.Objects.ContextMenuItem toManagedPtr :: ContextMenuItem -> ManagedPtr ContextMenuItem | |
TypedObject ContextMenuItem Source # | |
HasParentTypes ContextMenuItem Source # | |
IsGValue (Maybe ContextMenuItem) Source # | Convert |
Defined in GI.WebKitWebProcessExtension.Objects.ContextMenuItem gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ContextMenuItem -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ContextMenuItem) | |
type ParentTypes ContextMenuItem Source # | |
Defined in GI.WebKitWebProcessExtension.Objects.ContextMenuItem type ParentTypes ContextMenuItem = '[Object] |
class (GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o Source #
Type class for types which can be safely cast to ContextMenuItem
, for instance with toContextMenuItem
.
Instances
(GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o Source # | |
toContextMenuItem :: (MonadIO m, IsContextMenuItem o) => o -> m ContextMenuItem Source #
Cast to ContextMenuItem
, 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
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isSeparator, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getGaction, getProperty, getQdata, getStockAction, getSubmenu.
Setters
getGaction
contextMenuItemGetGaction Source #
:: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
=> a |
|
-> m Action | Returns: the |
Gets the action associated to item
as a Action
.
Since: 2.18
getStockAction
contextMenuItemGetStockAction Source #
:: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
=> a |
|
-> m ContextMenuAction | Returns: the |
Gets the ContextMenuAction
of item
.
If the ContextMenuItem
was not
created for a stock action ContextMenuActionCustom
will be
returned. If the ContextMenuItem
is a separator ContextMenuActionNoAction
will be returned.
getSubmenu
contextMenuItemGetSubmenu Source #
:: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
=> a |
|
-> m ContextMenu | Returns: the |
Gets the submenu of item
.
isSeparator
contextMenuItemIsSeparator Source #
:: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
=> a |
|
-> m Bool |
Checks whether item
is a separator.
newFromGaction
contextMenuItemNewFromGaction Source #
:: (HasCallStack, MonadIO m, IsAction a) | |
=> a |
|
-> Text |
|
-> Maybe GVariant |
|
-> m ContextMenuItem | Returns: the newly created |
Creates a new ContextMenuItem
for the given action
and label
.
On activation
target
will be passed as parameter to the callback.
Since: 2.18
newFromStockAction
contextMenuItemNewFromStockAction Source #
:: (HasCallStack, MonadIO m) | |
=> ContextMenuAction |
|
-> m ContextMenuItem | Returns: the newly created |
Creates a new ContextMenuItem
for the given stock action.
Stock actions are handled automatically by WebKit so that, for example,
when a menu item created with a ContextMenuActionStop
is
activated the action associated will be handled by WebKit and the current
load operation will be stopped. You can get the Action
of a
ContextMenuItem
created with a ContextMenuAction
with
contextMenuItemGetGaction
and connect to the SimpleAction::activate signal
to be notified when the item is activated, but you can't prevent the associated
action from being performed.
newFromStockActionWithLabel
contextMenuItemNewFromStockActionWithLabel Source #
:: (HasCallStack, MonadIO m) | |
=> ContextMenuAction |
|
-> Text |
|
-> m ContextMenuItem | Returns: the newly created |
Creates a new ContextMenuItem
for the given stock action using the given label
.
Stock actions have a predefined label, this method can be used to create a
ContextMenuItem
for a ContextMenuAction
but using a custom label.
newSeparator
contextMenuItemNewSeparator Source #
:: (HasCallStack, MonadIO m) | |
=> m ContextMenuItem | Returns: the newly created |
Creates a new ContextMenuItem
representing a separator.
newWithSubmenu
contextMenuItemNewWithSubmenu Source #
:: (HasCallStack, MonadIO m, IsContextMenu a) | |
=> Text |
|
-> a |
|
-> m ContextMenuItem | Returns: the newly created |
Creates a new ContextMenuItem
using the given label
with a submenu.
setSubmenu
contextMenuItemSetSubmenu Source #
:: (HasCallStack, MonadIO m, IsContextMenuItem a, IsContextMenu b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets or replaces the item
submenu.
If submenu
is Nothing
the current
submenu of item
is removed.