gi-gio
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

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

Exported types

newtype Menu Source #

Memory-managed wrapper type.

Constructors

Menu (ManagedPtr Menu) 

Instances

Instances details
Eq Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

(==) :: Menu -> Menu -> Bool #

(/=) :: Menu -> Menu -> Bool #

GObject Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

ManagedPtrNewtype Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

TypedObject Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

glibType :: IO GType #

HasParentTypes Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

HasAttributeList Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

(info ~ ResolveMenuMethod t Menu, OverloadedMethod info Menu p, HasField t Menu p) => HasField (t :: Symbol) Menu (p :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

getField :: Menu -> p #

(info ~ ResolveMenuMethod t Menu, OverloadedMethodInfo info Menu) => IsLabel t (MethodProxy info Menu) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

fromLabel :: MethodProxy info Menu #

(info ~ ResolveMenuMethod t Menu, OverloadedMethod info Menu p) => IsLabel t (Menu -> p) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

fromLabel :: Menu -> p #

IsGValue (Maybe Menu) Source #

Convert Menu to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gio.Objects.Menu

type AttributeList Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

type ParentTypes Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

type SignalList Menu Source # 
Instance details

Defined in GI.Gio.Objects.Menu

class (GObject o, IsDescendantOf Menu o) => IsMenu o Source #

Type class for types which can be safely cast to Menu, for instance with toMenu.

Instances

Instances details
(GObject o, IsDescendantOf Menu o) => IsMenu o Source # 
Instance details

Defined in GI.Gio.Objects.Menu

toMenu :: (MonadIO m, IsMenu o) => o -> m Menu Source #

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

Methods

type family ResolveMenuMethod (t :: Symbol) o where ... Source #

Equations

ResolveMenuMethod "append" o = MenuAppendMethodInfo 
ResolveMenuMethod "appendItem" o = MenuAppendItemMethodInfo 
ResolveMenuMethod "appendSection" o = MenuAppendSectionMethodInfo 
ResolveMenuMethod "appendSubmenu" o = MenuAppendSubmenuMethodInfo 
ResolveMenuMethod "bindProperty" o = ObjectBindPropertyMethodInfo 
ResolveMenuMethod "bindPropertyFull" o = ObjectBindPropertyFullMethodInfo 
ResolveMenuMethod "forceFloating" o = ObjectForceFloatingMethodInfo 
ResolveMenuMethod "freeze" o = MenuFreezeMethodInfo 
ResolveMenuMethod "freezeNotify" o = ObjectFreezeNotifyMethodInfo 
ResolveMenuMethod "getv" o = ObjectGetvMethodInfo 
ResolveMenuMethod "insert" o = MenuInsertMethodInfo 
ResolveMenuMethod "insertItem" o = MenuInsertItemMethodInfo 
ResolveMenuMethod "insertSection" o = MenuInsertSectionMethodInfo 
ResolveMenuMethod "insertSubmenu" o = MenuInsertSubmenuMethodInfo 
ResolveMenuMethod "isFloating" o = ObjectIsFloatingMethodInfo 
ResolveMenuMethod "isMutable" o = MenuModelIsMutableMethodInfo 
ResolveMenuMethod "itemsChanged" o = MenuModelItemsChangedMethodInfo 
ResolveMenuMethod "iterateItemAttributes" o = MenuModelIterateItemAttributesMethodInfo 
ResolveMenuMethod "iterateItemLinks" o = MenuModelIterateItemLinksMethodInfo 
ResolveMenuMethod "notify" o = ObjectNotifyMethodInfo 
ResolveMenuMethod "notifyByPspec" o = ObjectNotifyByPspecMethodInfo 
ResolveMenuMethod "prepend" o = MenuPrependMethodInfo 
ResolveMenuMethod "prependItem" o = MenuPrependItemMethodInfo 
ResolveMenuMethod "prependSection" o = MenuPrependSectionMethodInfo 
ResolveMenuMethod "prependSubmenu" o = MenuPrependSubmenuMethodInfo 
ResolveMenuMethod "ref" o = ObjectRefMethodInfo 
ResolveMenuMethod "refSink" o = ObjectRefSinkMethodInfo 
ResolveMenuMethod "remove" o = MenuRemoveMethodInfo 
ResolveMenuMethod "removeAll" o = MenuRemoveAllMethodInfo 
ResolveMenuMethod "runDispose" o = ObjectRunDisposeMethodInfo 
ResolveMenuMethod "stealData" o = ObjectStealDataMethodInfo 
ResolveMenuMethod "stealQdata" o = ObjectStealQdataMethodInfo 
ResolveMenuMethod "thawNotify" o = ObjectThawNotifyMethodInfo 
ResolveMenuMethod "unref" o = ObjectUnrefMethodInfo 
ResolveMenuMethod "watchClosure" o = ObjectWatchClosureMethodInfo 
ResolveMenuMethod "getData" o = ObjectGetDataMethodInfo 
ResolveMenuMethod "getItemAttributeValue" o = MenuModelGetItemAttributeValueMethodInfo 
ResolveMenuMethod "getItemLink" o = MenuModelGetItemLinkMethodInfo 
ResolveMenuMethod "getNItems" o = MenuModelGetNItemsMethodInfo 
ResolveMenuMethod "getProperty" o = ObjectGetPropertyMethodInfo 
ResolveMenuMethod "getQdata" o = ObjectGetQdataMethodInfo 
ResolveMenuMethod "setData" o = ObjectSetDataMethodInfo 
ResolveMenuMethod "setDataFull" o = ObjectSetDataFullMethodInfo 
ResolveMenuMethod "setProperty" o = ObjectSetPropertyMethodInfo 
ResolveMenuMethod l o = MethodResolutionFailed l o :: Type 

append

data MenuAppendMethodInfo Source #

Instances

Instances details
(signature ~ (Maybe Text -> Maybe Text -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuAppendMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuAppendMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuAppend Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Maybe Text

label: the section label, or Nothing

-> Maybe Text

detailedAction: the detailed action string, or Nothing

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

Instances details
(signature ~ (b -> m ()), MonadIO m, IsMenu a, IsMenuItem b) => OverloadedMethod MenuAppendItemMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuAppendItemMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuAppendItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) 
=> a

menu: a Menu

-> b

item: a MenuItem to append

-> m () 

Appends item to the end of menu.

See menuInsertItem for more information.

Since: 2.32

appendSection

data MenuAppendSectionMethodInfo Source #

Instances

Instances details
(signature ~ (Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuAppendSectionMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuAppendSectionMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuAppendSection Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) 
=> a

menu: a Menu

-> Maybe Text

label: the section label, or Nothing

-> b

section: a MenuModel with the items of the section

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

Instances details
(signature ~ (Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuAppendSubmenuMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuAppendSubmenuMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuAppendSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) 
=> a

menu: a Menu

-> Maybe Text

label: the section label, or Nothing

-> b

submenu: a MenuModel with the items of the submenu

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

Instances details
(signature ~ m (), MonadIO m, IsMenu a) => OverloadedMethod MenuFreezeMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuFreezeMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuFreeze Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

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

Instances details
(signature ~ (Int32 -> Maybe Text -> Maybe Text -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuInsertMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuInsertMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuInsert Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Int32

position: the position at which to insert the item

-> Maybe Text

label: the section label, or Nothing

-> Maybe Text

detailedAction: the detailed action string, or Nothing

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

Instances details
(signature ~ (Int32 -> b -> m ()), MonadIO m, IsMenu a, IsMenuItem b) => OverloadedMethod MenuInsertItemMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuInsertItemMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuInsertItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) 
=> a

menu: a Menu

-> Int32

position: the position at which to insert the item

-> b

item: the MenuItem to insert

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

Instances details
(signature ~ (Int32 -> Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuInsertSectionMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuInsertSectionMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuInsertSection Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) 
=> a

menu: a Menu

-> Int32

position: the position at which to insert the item

-> Maybe Text

label: the section label, or Nothing

-> b

section: a MenuModel with the items of the section

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

Instances details
(signature ~ (Int32 -> Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuInsertSubmenuMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuInsertSubmenuMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuInsertSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) 
=> a

menu: a Menu

-> Int32

position: the position at which to insert the item

-> Maybe Text

label: the section label, or Nothing

-> b

submenu: a MenuModel with the items of the submenu

-> m () 

Convenience function for inserting a submenu menu item into menu. Combine menuItemNewSubmenu and menuInsertItem for a more flexible alternative.

Since: 2.32

new

menuNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Menu

Returns: a new Menu

Creates a new Menu.

The new menu has no items.

Since: 2.32

prepend

data MenuPrependMethodInfo Source #

Instances

Instances details
(signature ~ (Maybe Text -> Maybe Text -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuPrependMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuPrependMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuPrepend Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Maybe Text

label: the section label, or Nothing

-> Maybe Text

detailedAction: the detailed action string, or Nothing

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

Instances details
(signature ~ (b -> m ()), MonadIO m, IsMenu a, IsMenuItem b) => OverloadedMethod MenuPrependItemMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuPrependItemMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuPrependItem Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuItem b) 
=> a

menu: a Menu

-> b

item: a MenuItem to prepend

-> m () 

Prepends item to the start of menu.

See menuInsertItem for more information.

Since: 2.32

prependSection

data MenuPrependSectionMethodInfo Source #

Instances

Instances details
(signature ~ (Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuPrependSectionMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuPrependSectionMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuPrependSection Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) 
=> a

menu: a Menu

-> Maybe Text

label: the section label, or Nothing

-> b

section: a MenuModel with the items of the section

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

Instances details
(signature ~ (Maybe Text -> b -> m ()), MonadIO m, IsMenu a, IsMenuModel b) => OverloadedMethod MenuPrependSubmenuMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuPrependSubmenuMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuPrependSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a, IsMenuModel b) 
=> a

menu: a Menu

-> Maybe Text

label: the section label, or Nothing

-> b

submenu: a MenuModel with the items of the submenu

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

Instances details
(signature ~ (Int32 -> m ()), MonadIO m, IsMenu a) => OverloadedMethod MenuRemoveMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuRemoveMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> Int32

position: the position of the item to remove

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

Instances details
(signature ~ m (), MonadIO m, IsMenu a) => OverloadedMethod MenuRemoveAllMethodInfo a signature Source # 
Instance details

Defined in GI.Gio.Objects.Menu

Methods

overloadedMethod :: a -> signature #

OverloadedMethodInfo MenuRemoveAllMethodInfo (a :: Type) Source # 
Instance details

Defined in GI.Gio.Objects.Menu

menuRemoveAll Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenu a) 
=> a

menu: a Menu

-> m () 

Removes all items in the menu.

Since: 2.38