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.Gio.Objects.Menu
Description
GMenu
is a simple implementation of MenuModel
.
You populate a GMenu
by adding MenuItem
instances to it.
There are some convenience functions to allow you to directly
add items (avoiding MenuItem
) for the common cases. To add
a regular item, use menuInsert
. To add a section, use
menuInsertSection
. To add a submenu, use
menuInsertSubmenu
.
Since: 2.32
Synopsis
- newtype Menu = Menu (ManagedPtr Menu)
- class (GObject o, IsDescendantOf Menu o) => IsMenu o
- toMenu :: (MonadIO m, IsMenu o) => o -> m Menu
- type family ResolveMenuMethod (t :: Symbol) o where ...
- data MenuAppendMethodInfo
- menuAppend :: (HasCallStack, MonadIO m, IsMenu a) => a -> Maybe Text -> Maybe Text -> m ()
- data MenuAppendItemMethodInfo
- menuAppendItem :: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) => a -> b -> m ()
- data MenuAppendSectionMethodInfo
- menuAppendSection :: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) => a -> Maybe Text -> b -> m ()
- data MenuAppendSubmenuMethodInfo
- menuAppendSubmenu :: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) => a -> Maybe Text -> b -> m ()
- data MenuFreezeMethodInfo
- menuFreeze :: (HasCallStack, MonadIO m, IsMenu a) => a -> m ()
- data MenuInsertMethodInfo
- menuInsert :: (HasCallStack, MonadIO m, IsMenu a) => a -> Int32 -> Maybe Text -> Maybe Text -> m ()
- data MenuInsertItemMethodInfo
- menuInsertItem :: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) => a -> Int32 -> b -> m ()
- data MenuInsertSectionMethodInfo
- menuInsertSection :: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) => a -> Int32 -> Maybe Text -> b -> m ()
- data MenuInsertSubmenuMethodInfo
- menuInsertSubmenu :: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) => a -> Int32 -> Maybe Text -> b -> m ()
- menuNew :: (HasCallStack, MonadIO m) => m Menu
- data MenuPrependMethodInfo
- menuPrepend :: (HasCallStack, MonadIO m, IsMenu a) => a -> Maybe Text -> Maybe Text -> m ()
- data MenuPrependItemMethodInfo
- menuPrependItem :: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) => a -> b -> m ()
- data MenuPrependSectionMethodInfo
- menuPrependSection :: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) => a -> Maybe Text -> b -> m ()
- data MenuPrependSubmenuMethodInfo
- menuPrependSubmenu :: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) => a -> Maybe Text -> b -> m ()
- data MenuRemoveMethodInfo
- menuRemove :: (HasCallStack, MonadIO m, IsMenu a) => a -> Int32 -> m ()
- data MenuRemoveAllMethodInfo
- menuRemoveAll :: (HasCallStack, MonadIO m, IsMenu a) => a -> m ()
Exported types
Memory-managed wrapper type.
Constructors
Menu (ManagedPtr Menu) |
Instances
class (GObject o, IsDescendantOf Menu o) => IsMenu o Source #
Instances
(GObject o, IsDescendantOf Menu o) => IsMenu o Source # | |
Defined in GI.Gio.Objects.Menu |
Methods
Click to display all available methods, including inherited ones
Methods
append, appendItem, appendSection, appendSubmenu, bindProperty, bindPropertyFull, forceFloating, freeze, freezeNotify, getv, insert, insertItem, insertSection, insertSubmenu, isFloating, isMutable, itemsChanged, iterateItemAttributes, iterateItemLinks, notify, notifyByPspec, prepend, prependItem, prependSection, prependSubmenu, ref, refSink, remove, removeAll, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getItemAttributeValue, getItemLink, getNItems, getProperty, getQdata.
Setters
type family ResolveMenuMethod (t :: Symbol) o where ... Source #
Equations
append
data MenuAppendMethodInfo Source #
Instances
(signature ~ (Maybe Text -> Maybe Text -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuAppendMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuAppendMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m () |
Convenience function for appending a normal menu item to the end of
menu
. Combine menuItemNew
and menuInsertItem
for a more
flexible alternative.
Since: 2.32
appendItem
data MenuAppendItemMethodInfo Source #
Instances
(signature ~ (b -> m ()), MonadIO m, IsMenu a, IsMenuItem b) => OverloadedMethod MenuAppendItemMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuAppendItemMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) | |
=> a |
|
-> b |
|
-> m () |
appendSection
data MenuAppendSectionMethodInfo Source #
Instances
(signature ~ (Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuAppendSectionMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuAppendSectionMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) | |
=> a |
|
-> Maybe Text |
|
-> b |
|
-> m () |
Convenience function for appending a section menu item to the end of
menu
. Combine menuItemNewSection
and menuInsertItem
for a
more flexible alternative.
Since: 2.32
appendSubmenu
data MenuAppendSubmenuMethodInfo Source #
Instances
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) | |
=> a |
|
-> Maybe Text |
|
-> b |
|
-> m () |
Convenience function for appending a submenu menu item to the end of
menu
. Combine menuItemNewSubmenu
and menuInsertItem
for a
more flexible alternative.
Since: 2.32
freeze
data MenuFreezeMethodInfo Source #
Instances
(signature ~ m (), MonadIO m, IsMenu a) => OverloadedMethod MenuFreezeMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuFreezeMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a) | |
=> a |
|
-> m () |
Marks menu
as frozen.
After the menu is frozen, it is an error to attempt to make any
changes to it. In effect this means that the Menu
API must no
longer be used.
This function causes menuModelIsMutable
to begin returning
False
, which has some positive performance implications.
Since: 2.32
insert
data MenuInsertMethodInfo Source #
Instances
(signature ~ (Int32 -> Maybe Text -> Maybe Text -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuInsertMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuInsertMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a) | |
=> a |
|
-> Int32 |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m () |
Convenience function for inserting a normal menu item into menu
.
Combine menuItemNew
and menuInsertItem
for a more flexible
alternative.
Since: 2.32
insertItem
data MenuInsertItemMethodInfo Source #
Instances
(signature ~ (Int32 -> b -> m ()), MonadIO m, IsMenu a, IsMenuItem b) => OverloadedMethod MenuInsertItemMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuInsertItemMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) | |
=> a |
|
-> Int32 |
|
-> b |
|
-> m () |
Inserts item
into menu
.
The "insertion" is actually done by copying all of the attribute and
link values of item
and using them to form a new item within menu
.
As such, item
itself is not really inserted, but rather, a menu item
that is exactly the same as the one presently described by item
.
This means that item
is essentially useless after the insertion
occurs. Any changes you make to it are ignored unless it is inserted
again (at which point its updated values will be copied).
You should probably just free item
once you're done.
There are many convenience functions to take care of common cases.
See menuInsert
, menuInsertSection
and
menuInsertSubmenu
as well as "prepend" and "append" variants of
each of these functions.
Since: 2.32
insertSection
data MenuInsertSectionMethodInfo Source #
Instances
(signature ~ (Int32 -> Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuInsertSectionMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuInsertSectionMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) | |
=> a |
|
-> Int32 |
|
-> Maybe Text |
|
-> b |
|
-> m () |
Convenience function for inserting a section menu item into menu
.
Combine menuItemNewSection
and menuInsertItem
for a more
flexible alternative.
Since: 2.32
insertSubmenu
data MenuInsertSubmenuMethodInfo Source #
Instances
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) | |
=> a |
|
-> Int32 |
|
-> Maybe Text |
|
-> b |
|
-> m () |
Convenience function for inserting a submenu menu item into menu
.
Combine menuItemNewSubmenu
and menuInsertItem
for a more
flexible alternative.
Since: 2.32
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Menu | Returns: a new |
prepend
data MenuPrependMethodInfo Source #
Instances
(signature ~ (Maybe Text -> Maybe Text -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuPrependMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuPrependMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a) | |
=> a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m () |
Convenience function for prepending a normal menu item to the start
of menu
. Combine menuItemNew
and menuInsertItem
for a more
flexible alternative.
Since: 2.32
prependItem
data MenuPrependItemMethodInfo Source #
Instances
(signature ~ (b -> m ()), MonadIO m, IsMenu a, IsMenuItem b) => OverloadedMethod MenuPrependItemMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuPrependItemMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) | |
=> a |
|
-> b |
|
-> m () |
prependSection
data MenuPrependSectionMethodInfo Source #
Instances
(signature ~ (Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuPrependSectionMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuPrependSectionMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) | |
=> a |
|
-> Maybe Text |
|
-> b |
|
-> m () |
Convenience function for prepending a section menu item to the start
of menu
. Combine menuItemNewSection
and menuInsertItem
for
a more flexible alternative.
Since: 2.32
prependSubmenu
data MenuPrependSubmenuMethodInfo Source #
Instances
Arguments
:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) | |
=> a |
|
-> Maybe Text |
|
-> b |
|
-> m () |
Convenience function for prepending a submenu menu item to the start
of menu
. Combine menuItemNewSubmenu
and menuInsertItem
for
a more flexible alternative.
Since: 2.32
remove
data MenuRemoveMethodInfo Source #
Instances
(signature ~ (Int32 -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuRemoveMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuRemoveMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a) | |
=> a |
|
-> Int32 |
|
-> m () |
Removes an item from the menu.
position
gives the index of the item to remove.
It is an error if position is not in range the range from 0 to one less than the number of items in the menu.
It is not possible to remove items by identity since items are added to the menu simply by copying their links and attributes (ie: identity of the item itself is not preserved).
Since: 2.32
removeAll
data MenuRemoveAllMethodInfo Source #
Instances
(signature ~ m (), MonadIO m, IsMenu a) => OverloadedMethod MenuRemoveAllMethodInfo a signature Source # | |
Defined in GI.Gio.Objects.Menu Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo MenuRemoveAllMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Objects.Menu Methods |
Arguments
:: (HasCallStack, MonadIO m, IsMenu a) | |
=> a |
|
-> m () |
Removes all items in the menu.
Since: 2.38