gi-gtk-3.0.43: Gtk bindings

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.Gtk.Objects.MenuItem

Contents

- Exported types
- Methods
  - activate
  - deselect
  - getAccelPath
  - getLabel
  - getReserveIndicator
  - getRightJustified
  - getSubmenu
  - getUseUnderline
  - new
  - newWithLabel
  - newWithMnemonic
  - select
  - setAccelPath
  - setLabel
  - setReserveIndicator
  - setRightJustified
  - setSubmenu
  - setUseUnderline
  - toggleSizeAllocate
  - toggleSizeRequest
- Properties
  - accelPath
  - label
  - rightJustified
  - submenu
  - useUnderline
- Signals
  - activate
  - activateItem
  - deselect
  - select
  - toggleSizeAllocate
  - toggleSizeRequest

Description

The `MenuItem` widget and the derived widgets are the only valid children for menus. Their function is to correctly handle highlighting, alignment, events and submenus.

As a GtkMenuItem derives from `Bin` it can hold any valid child widget, although only a few are really useful.

By default, a GtkMenuItem sets a `AccelLabel` as its child. GtkMenuItem has direct functions to set the label and its mnemonic. For more advanced label settings, you can fetch the child widget from the GtkBin.

An example for setting markup and accelerator on a MenuItem:

### C code

    GtkWidget *menu_item = gtk_menu_item_new_with_label ("Example Menu Item");

    GtkWidget *child = gtk_bin_get_child (GTK_BIN (menu_item));
    gtk_label_set_markup (GTK_LABEL (child), "<i>new label</i> with <b>markup</b>");
    gtk_accel_label_set_accel (GTK_ACCEL_LABEL (child), GDK_KEY_1, 0);

# GtkMenuItem as GtkBuildable

The GtkMenuItem implementation of the `Buildable` interface supports adding a submenu by specifying “submenu” as the “type” attribute of a `<child>` element.

An example of UI definition fragment with submenus:

### xml code

    <object class="GtkMenuItem">
      <child type="submenu">
        <object class="GtkMenu"/>
      </child>
    </object>

# CSS nodes

### plain code

    menuitem
    ├── <child>
    ╰── [arrow.right]

GtkMenuItem has a single CSS node with name menuitem. If the menuitem has a submenu, it gets another CSS node with name arrow, which has the .left or .right style class.

Synopsis

- newtype MenuItem = MenuItem (ManagedPtr MenuItem)
- class (GObject o, IsDescendantOf MenuItem o) => IsMenuItem o
- toMenuItem :: (MonadIO m, IsMenuItem o) => o -> m MenuItem
- menuItemActivate :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m ()
- menuItemDeselect :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m ()
- menuItemGetAccelPath :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m (Maybe Text)
- menuItemGetLabel :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m Text
- menuItemGetReserveIndicator :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m Bool
- menuItemGetRightJustified :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m Bool
- menuItemGetSubmenu :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m (Maybe Widget)
- menuItemGetUseUnderline :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m Bool
- menuItemNew :: (HasCallStack, MonadIO m) => m MenuItem
- menuItemNewWithLabel :: (HasCallStack, MonadIO m) => Text -> m MenuItem
- menuItemNewWithMnemonic :: (HasCallStack, MonadIO m) => Text -> m MenuItem
- menuItemSelect :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> m ()
- menuItemSetAccelPath :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Maybe Text -> m ()
- menuItemSetLabel :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Text -> m ()
- menuItemSetReserveIndicator :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Bool -> m ()
- menuItemSetRightJustified :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Bool -> m ()
- menuItemSetSubmenu :: (HasCallStack, MonadIO m, IsMenuItem a, IsMenu b) => a -> Maybe b -> m ()
- menuItemSetUseUnderline :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Bool -> m ()
- menuItemToggleSizeAllocate :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Int32 -> m ()
- menuItemToggleSizeRequest :: (HasCallStack, MonadIO m, IsMenuItem a) => a -> Int32 -> m Int32
- clearMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> m ()
- constructMenuItemAccelPath :: (IsMenuItem o, MonadIO m) => Text -> m (GValueConstruct o)
- getMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> m (Maybe Text)
- setMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> Text -> m ()
- constructMenuItemLabel :: (IsMenuItem o, MonadIO m) => Text -> m (GValueConstruct o)
- getMenuItemLabel :: (MonadIO m, IsMenuItem o) => o -> m Text
- setMenuItemLabel :: (MonadIO m, IsMenuItem o) => o -> Text -> m ()
- constructMenuItemRightJustified :: (IsMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMenuItemRightJustified :: (MonadIO m, IsMenuItem o) => o -> m Bool
- setMenuItemRightJustified :: (MonadIO m, IsMenuItem o) => o -> Bool -> m ()
- clearMenuItemSubmenu :: (MonadIO m, IsMenuItem o) => o -> m ()
- constructMenuItemSubmenu :: (IsMenuItem o, MonadIO m, IsMenu a) => a -> m (GValueConstruct o)
- getMenuItemSubmenu :: (MonadIO m, IsMenuItem o) => o -> m (Maybe Menu)
- setMenuItemSubmenu :: (MonadIO m, IsMenuItem o, IsMenu a) => o -> a -> m ()
- constructMenuItemUseUnderline :: (IsMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMenuItemUseUnderline :: (MonadIO m, IsMenuItem o) => o -> m Bool
- setMenuItemUseUnderline :: (MonadIO m, IsMenuItem o) => o -> Bool -> m ()
- type MenuItemActivateCallback = IO ()
- afterMenuItemActivate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateCallback) -> m SignalHandlerId
- onMenuItemActivate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateCallback) -> m SignalHandlerId
- type MenuItemActivateItemCallback = IO ()
- afterMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateItemCallback) -> m SignalHandlerId
- onMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateItemCallback) -> m SignalHandlerId
- type MenuItemDeselectCallback = IO ()
- afterMenuItemDeselect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemDeselectCallback) -> m SignalHandlerId
- onMenuItemDeselect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemDeselectCallback) -> m SignalHandlerId
- type MenuItemSelectCallback = IO ()
- afterMenuItemSelect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemSelectCallback) -> m SignalHandlerId
- onMenuItemSelect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemSelectCallback) -> m SignalHandlerId
- type MenuItemToggleSizeAllocateCallback = Int32 -> IO ()
- afterMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeAllocateCallback) -> m SignalHandlerId
- onMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeAllocateCallback) -> m SignalHandlerId
- type MenuItemToggleSizeRequestCallback = Ptr () -> IO ()
- afterMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeRequestCallback) -> m SignalHandlerId
- onMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeRequestCallback) -> m SignalHandlerId

# Exported types

newtype MenuItem Source #

Memory-managed wrapper type.

Constructors

MenuItem (ManagedPtr MenuItem) |

#### Instances

Instances details

Eq MenuItem Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem Methods (==) :: MenuItem -> MenuItem -> Bool Source # (/=) :: MenuItem -> MenuItem -> Bool Source #
GObject MenuItem Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem
ManagedPtrNewtype MenuItem Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem Methods toManagedPtr :: MenuItem -> ManagedPtr MenuItem Source #
TypedObject MenuItem Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem Methods glibType :: IO GType Source #
HasParentTypes MenuItem Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem
IsGValue (Maybe MenuItem) Source # | Convert `MenuItem` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.MenuItem Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe MenuItem -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe MenuItem) Source #
type ParentTypes MenuItem Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem type ParentTypes MenuItem = '[Bin, Container, Widget, Object, ImplementorIface, Actionable, Activatable, Buildable]

class (GObject o, IsDescendantOf MenuItem o) => IsMenuItem o Source #

Type class for types which can be safely cast to `MenuItem`, for instance with `toMenuItem`.

#### Instances

Instances details

(GObject o, IsDescendantOf MenuItem o) => IsMenuItem o Source # |
Instance details Defined in GI.Gtk.Objects.MenuItem

toMenuItem :: (MonadIO m, IsMenuItem o) => o -> m MenuItem Source #

Cast to `MenuItem`, 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

Expand

#### Methods

activate, add, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, checkResize, childFocus, childGetProperty, childNotify, childNotifyByPspec, childSetProperty, childType, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, deselect, destroy, destroyed, deviceIsShadowed, doSetRelatedAction, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forall, forceFloating, foreach, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, propagateDraw, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, remove, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, resizeChildren, runDispose, select, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, syncActionProperties, thawChildNotify, thawNotify, toggleSizeAllocate, toggleSizeRequest, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.

#### Getters

getAccelPath, getAccessible, getActionGroup, getActionName, getActionTargetValue, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getLabel, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPathForChild, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRelatedAction, getRequestMode, getRequisition, getReserveIndicator, getResizeMode, getRightJustified, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStyle, getStyleContext, getSubmenu, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getUseActionAppearance, getUseUnderline, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.

#### Setters

setAccelPath, setActionName, setActionTargetValue, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDetailedActionName, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setLabel, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setProperty, setRealized, setReallocateRedraws, setReceivesDefault, setRedrawOnAllocate, setRelatedAction, setReserveIndicator, setResizeMode, setRightJustified, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSubmenu, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setUseActionAppearance, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

## activate

menuItemActivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: the menu item
-> m () |

Emits the MenuItem::activate signal on the given item

## deselect

menuItemDeselect Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: the menu item
-> m () |

Emits the MenuItem::deselect signal on the given item.

## getAccelPath

menuItemGetAccelPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a valid `MenuItem`
-> m (Maybe Text) | Returns: the accelerator path corresponding to this menu item’s functionality, or `Nothing` if not set

Retrieve the accelerator path that was previously set on `menuItem`.

See `menuItemSetAccelPath` for details.

Since: 2.14

## getLabel

menuItemGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> m Text | Returns: The text in the `menuItem` label. This is the internal string used by the label, and must not be modified.

Sets `text` on the `menuItem` label

Since: 2.16

## getReserveIndicator

menuItemGetReserveIndicator Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> m Bool | Returns: `True` if `menuItem` always reserves space for the submenu indicator

Returns whether the `menuItem` reserves space for the submenu indicator, regardless if it has a submenu or not.

Since: 3.0

## getRightJustified

menuItemGetRightJustified Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> m Bool | Returns: `True` if the menu item will appear at the far right if added to a menu bar.

Deprecated: (Since version 3.2)See `menuItemSetRightJustified`

Gets whether the menu item appears justified at the right side of the menu bar.

## getSubmenu

menuItemGetSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> m (Maybe Widget) | Returns: submenu for this menu item, or `Nothing` if none

Gets the submenu underneath this menu item, if any. See `menuItemSetSubmenu`.

## getUseUnderline

menuItemGetUseUnderline Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> m Bool | Returns: `True` if an embedded underline in the label indicates the mnemonic accelerator key.

Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.

Since: 2.16

## new

menuItemNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m MenuItem | Returns: the newly created `MenuItem`

Creates a new `MenuItem`.

## newWithLabel

menuItemNewWithLabel Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `label`: the text for the label
-> m MenuItem | Returns: the newly created `MenuItem`

Creates a new `MenuItem` whose child is a `Label`.

## newWithMnemonic

menuItemNewWithMnemonic Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `label`: The text of the button, with an underscore in front of the mnemonic character
-> m MenuItem | Returns: a new `MenuItem`

Creates a new `MenuItem` containing a label.

The label will be created using `labelNewWithMnemonic`, so underscores in `label` indicate the mnemonic for the menu item.

## select

menuItemSelect Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: the menu item
-> m () |

Emits the MenuItem::select signal on the given item.

## setAccelPath

menuItemSetAccelPath Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a valid `MenuItem`
-> Maybe Text | `accelPath`: accelerator path, corresponding to this menu item’s functionality, or `Nothing` to unset the current path.
-> m () |

Set the accelerator path on `menuItem`, through which runtime changes of the menu item’s accelerator caused by the user can be identified and saved to persistent storage (see `accelMapSave` on this). To set up a default accelerator for this menu item, call `accelMapAddEntry` with the same `accelPath`. See also `accelMapAddEntry` on the specifics of accelerator paths, and `menuSetAccelPath` for a more convenient variant of this function.

This function is basically a convenience wrapper that handles calling `widgetSetAccelPath` with the appropriate accelerator group for the menu item.

Note that you do need to set an accelerator on the parent menu with `menuSetAccelGroup` for this to work.

Note that `accelPath` string will be stored in a `GQuark`. Therefore, if you pass a static string, you can save some memory by interning it first with `internStaticString`.

## setLabel

menuItemSetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> Text | `label`: the text you want to set
-> m () |

Sets `text` on the `menuItem` label

Since: 2.16

## setReserveIndicator

menuItemSetReserveIndicator Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> Bool | `reserve`: the new value
-> m () |

Sets whether the `menuItem` should reserve space for the submenu indicator, regardless if it actually has a submenu or not.

There should be little need for applications to call this functions.

Since: 3.0

## setRightJustified

menuItemSetRightJustified Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`.
-> Bool | `rightJustified`: if `True` the menu item will appear at the far right if added to a menu bar
-> m () |

Deprecated: (Since version 3.2)If you insist on using it, use`widgetSetHexpand` and `widgetSetHalign`.

Sets whether the menu item appears justified at the right side of a menu bar. This was traditionally done for “Help” menu items, but is now considered a bad idea. (If the widget layout is reversed for a right-to-left language like Hebrew or Arabic, right-justified-menu-items appear at the left.)

## setSubmenu

menuItemSetSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a, IsMenu b) |
=> a | `menuItem`: a `MenuItem`
-> Maybe b | `submenu`: the submenu, or `Nothing`
-> m () |

Sets or replaces the menu item’s submenu, or removes it when a `Nothing` submenu is passed.

## setUseUnderline

menuItemSetUseUnderline Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: a `MenuItem`
-> Bool | `setting`: `True` if underlines in the text indicate mnemonics
-> m () |

If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

Since: 2.16

## toggleSizeAllocate

menuItemToggleSizeAllocate Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: the menu item.
-> Int32 | `allocation`: the allocation to use as signal data.
-> m () |

Emits the MenuItem::toggleSizeAllocate signal on the given item.

## toggleSizeRequest

menuItemToggleSizeRequest Source #

Arguments

:: (HasCallStack, MonadIO m, IsMenuItem a) |
=> a | `menuItem`: the menu item
-> Int32 | `requisition`: the requisition to use as signal data.
-> m Int32 |

Emits the MenuItem::toggleSizeRequest signal on the given item.

# Properties

## accelPath

Sets the accelerator path of the menu item, through which runtime changes of the menu item's accelerator caused by the user can be identified and saved to persistant storage.

Since: 2.14

clearMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> m () Source #

Set the value of the “`accel-path`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #accelPath

constructMenuItemAccelPath :: (IsMenuItem o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`accel-path`” property. This is rarely needed directly, but it is used by `new`.

getMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> m (Maybe Text) Source #

Get the value of the “`accel-path`” property. When overloading is enabled, this is equivalent to

    get menuItem #accelPath

setMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> Text -> m () Source #

Set the value of the “`accel-path`” property. When overloading is enabled, this is equivalent to

    set menuItem [ #accelPath := value ]

## label

The text for the child label.

Since: 2.16

constructMenuItemLabel :: (IsMenuItem o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`label`” property. This is rarely needed directly, but it is used by `new`.

getMenuItemLabel :: (MonadIO m, IsMenuItem o) => o -> m Text Source #

Get the value of the “`label`” property. When overloading is enabled, this is equivalent to

    get menuItem #label

setMenuItemLabel :: (MonadIO m, IsMenuItem o) => o -> Text -> m () Source #

Set the value of the “`label`” property. When overloading is enabled, this is equivalent to

    set menuItem [ #label := value ]

## rightJustified

Sets whether the menu item appears justified at the right side of a menu bar.

Since: 2.14

constructMenuItemRightJustified :: (IsMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`right-justified`” property. This is rarely needed directly, but it is used by `new`.

getMenuItemRightJustified :: (MonadIO m, IsMenuItem o) => o -> m Bool Source #

Get the value of the “`right-justified`” property. When overloading is enabled, this is equivalent to

    get menuItem #rightJustified

setMenuItemRightJustified :: (MonadIO m, IsMenuItem o) => o -> Bool -> m () Source #

Set the value of the “`right-justified`” property. When overloading is enabled, this is equivalent to

    set menuItem [ #rightJustified := value ]

## submenu

The submenu attached to the menu item, or `Nothing` if it has none.

Since: 2.12

clearMenuItemSubmenu :: (MonadIO m, IsMenuItem o) => o -> m () Source #

Set the value of the “`submenu`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #submenu

constructMenuItemSubmenu :: (IsMenuItem o, MonadIO m, IsMenu a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`submenu`” property. This is rarely needed directly, but it is used by `new`.

getMenuItemSubmenu :: (MonadIO m, IsMenuItem o) => o -> m (Maybe Menu) Source #

Get the value of the “`submenu`” property. When overloading is enabled, this is equivalent to

    get menuItem #submenu

setMenuItemSubmenu :: (MonadIO m, IsMenuItem o, IsMenu a) => o -> a -> m () Source #

Set the value of the “`submenu`” property. When overloading is enabled, this is equivalent to

    set menuItem [ #submenu := value ]

## useUnderline

`True` if underlines in the text indicate mnemonics.

Since: 2.16

constructMenuItemUseUnderline :: (IsMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`use-underline`” property. This is rarely needed directly, but it is used by `new`.

getMenuItemUseUnderline :: (MonadIO m, IsMenuItem o) => o -> m Bool Source #

Get the value of the “`use-underline`” property. When overloading is enabled, this is equivalent to

    get menuItem #useUnderline

setMenuItemUseUnderline :: (MonadIO m, IsMenuItem o) => o -> Bool -> m () Source #

Set the value of the “`use-underline`” property. When overloading is enabled, this is equivalent to

    set menuItem [ #useUnderline := value ]

# Signals

## activate

type MenuItemActivateCallback = IO () Source #

Emitted when the item is activated.

afterMenuItemActivate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateCallback) -> 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 menuItem #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.

onMenuItemActivate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateCallback) -> 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 menuItem #activate callback

## activateItem

type MenuItemActivateItemCallback = IO () Source #

Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is MenuItem::activate.

afterMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateItemCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activateItem signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuItem #activateItem 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.

onMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemActivateItemCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activateItem signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuItem #activateItem callback

## deselect

type MenuItemDeselectCallback = IO () Source #

No description available in the introspection data.

afterMenuItemDeselect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemDeselectCallback) -> m SignalHandlerId Source #

Connect a signal handler for the deselect signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuItem #deselect 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.

onMenuItemDeselect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemDeselectCallback) -> m SignalHandlerId Source #

Connect a signal handler for the deselect signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuItem #deselect callback

## select

type MenuItemSelectCallback = IO () Source #

No description available in the introspection data.

afterMenuItemSelect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemSelectCallback) -> m SignalHandlerId Source #

Connect a signal handler for the select signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuItem #select 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.

onMenuItemSelect :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemSelectCallback) -> m SignalHandlerId Source #

Connect a signal handler for the select signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuItem #select callback

## toggleSizeAllocate

type MenuItemToggleSizeAllocateCallback = Int32 -> IO () Source #

No description available in the introspection data.

afterMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeAllocateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggleSizeAllocate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuItem #toggleSizeAllocate 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.

onMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeAllocateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggleSizeAllocate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuItem #toggleSizeAllocate callback

## toggleSizeRequest

type MenuItemToggleSizeRequestCallback = Ptr () -> IO () Source #

No description available in the introspection data.

afterMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeRequestCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggleSizeRequest signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after menuItem #toggleSizeRequest 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.

onMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => a -> ((?self :: a) => MenuItemToggleSizeRequestCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggleSizeRequest signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on menuItem #toggleSizeRequest callback