Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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: > >class="GtkMenuItem" > type="submenu" > 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 C_MenuItemActivateCallback = Ptr () -> Ptr () -> IO ()
- type MenuItemActivateCallback = IO ()
- afterMenuItemActivate :: (IsMenuItem a, MonadIO m) => a -> MenuItemActivateCallback -> m SignalHandlerId
- genClosure_MenuItemActivate :: MonadIO m => MenuItemActivateCallback -> m (GClosure C_MenuItemActivateCallback)
- mk_MenuItemActivateCallback :: C_MenuItemActivateCallback -> IO (FunPtr C_MenuItemActivateCallback)
- noMenuItemActivateCallback :: Maybe MenuItemActivateCallback
- onMenuItemActivate :: (IsMenuItem a, MonadIO m) => a -> MenuItemActivateCallback -> m SignalHandlerId
- wrap_MenuItemActivateCallback :: MenuItemActivateCallback -> C_MenuItemActivateCallback
- type C_MenuItemActivateItemCallback = Ptr () -> Ptr () -> IO ()
- type MenuItemActivateItemCallback = IO ()
- afterMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> MenuItemActivateItemCallback -> m SignalHandlerId
- genClosure_MenuItemActivateItem :: MonadIO m => MenuItemActivateItemCallback -> m (GClosure C_MenuItemActivateItemCallback)
- mk_MenuItemActivateItemCallback :: C_MenuItemActivateItemCallback -> IO (FunPtr C_MenuItemActivateItemCallback)
- noMenuItemActivateItemCallback :: Maybe MenuItemActivateItemCallback
- onMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> MenuItemActivateItemCallback -> m SignalHandlerId
- wrap_MenuItemActivateItemCallback :: MenuItemActivateItemCallback -> C_MenuItemActivateItemCallback
- type C_MenuItemDeselectCallback = Ptr () -> Ptr () -> IO ()
- type MenuItemDeselectCallback = IO ()
- afterMenuItemDeselect :: (IsMenuItem a, MonadIO m) => a -> MenuItemDeselectCallback -> m SignalHandlerId
- genClosure_MenuItemDeselect :: MonadIO m => MenuItemDeselectCallback -> m (GClosure C_MenuItemDeselectCallback)
- mk_MenuItemDeselectCallback :: C_MenuItemDeselectCallback -> IO (FunPtr C_MenuItemDeselectCallback)
- noMenuItemDeselectCallback :: Maybe MenuItemDeselectCallback
- onMenuItemDeselect :: (IsMenuItem a, MonadIO m) => a -> MenuItemDeselectCallback -> m SignalHandlerId
- wrap_MenuItemDeselectCallback :: MenuItemDeselectCallback -> C_MenuItemDeselectCallback
- type C_MenuItemSelectCallback = Ptr () -> Ptr () -> IO ()
- type MenuItemSelectCallback = IO ()
- afterMenuItemSelect :: (IsMenuItem a, MonadIO m) => a -> MenuItemSelectCallback -> m SignalHandlerId
- genClosure_MenuItemSelect :: MonadIO m => MenuItemSelectCallback -> m (GClosure C_MenuItemSelectCallback)
- mk_MenuItemSelectCallback :: C_MenuItemSelectCallback -> IO (FunPtr C_MenuItemSelectCallback)
- noMenuItemSelectCallback :: Maybe MenuItemSelectCallback
- onMenuItemSelect :: (IsMenuItem a, MonadIO m) => a -> MenuItemSelectCallback -> m SignalHandlerId
- wrap_MenuItemSelectCallback :: MenuItemSelectCallback -> C_MenuItemSelectCallback
- type C_MenuItemToggleSizeAllocateCallback = Ptr () -> Int32 -> Ptr () -> IO ()
- type MenuItemToggleSizeAllocateCallback = Int32 -> IO ()
- afterMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => a -> MenuItemToggleSizeAllocateCallback -> m SignalHandlerId
- genClosure_MenuItemToggleSizeAllocate :: MonadIO m => MenuItemToggleSizeAllocateCallback -> m (GClosure C_MenuItemToggleSizeAllocateCallback)
- mk_MenuItemToggleSizeAllocateCallback :: C_MenuItemToggleSizeAllocateCallback -> IO (FunPtr C_MenuItemToggleSizeAllocateCallback)
- noMenuItemToggleSizeAllocateCallback :: Maybe MenuItemToggleSizeAllocateCallback
- onMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => a -> MenuItemToggleSizeAllocateCallback -> m SignalHandlerId
- wrap_MenuItemToggleSizeAllocateCallback :: MenuItemToggleSizeAllocateCallback -> C_MenuItemToggleSizeAllocateCallback
- type C_MenuItemToggleSizeRequestCallback = Ptr () -> Ptr () -> Ptr () -> IO ()
- type MenuItemToggleSizeRequestCallback = Ptr () -> IO ()
- afterMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => a -> MenuItemToggleSizeRequestCallback -> m SignalHandlerId
- genClosure_MenuItemToggleSizeRequest :: MonadIO m => MenuItemToggleSizeRequestCallback -> m (GClosure C_MenuItemToggleSizeRequestCallback)
- mk_MenuItemToggleSizeRequestCallback :: C_MenuItemToggleSizeRequestCallback -> IO (FunPtr C_MenuItemToggleSizeRequestCallback)
- noMenuItemToggleSizeRequestCallback :: Maybe MenuItemToggleSizeRequestCallback
- onMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => a -> MenuItemToggleSizeRequestCallback -> m SignalHandlerId
- wrap_MenuItemToggleSizeRequestCallback :: MenuItemToggleSizeRequestCallback -> C_MenuItemToggleSizeRequestCallback
Exported types
Memory-managed wrapper type.
Instances
Eq MenuItem Source # | |
GObject MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
ManagedPtrNewtype MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem toManagedPtr :: MenuItem -> ManagedPtr MenuItem | |
TypedObject MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
HasParentTypes MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsGValue (Maybe MenuItem) Source # | Convert |
Defined in GI.Gtk.Objects.MenuItem gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe MenuItem -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe MenuItem) | |
type ParentTypes MenuItem Source # | |
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
(GObject o, IsDescendantOf MenuItem o) => IsMenuItem o Source # | |
Defined in GI.Gtk.Objects.MenuItem |
toMenuItem :: (MonadIO m, IsMenuItem o) => o -> m MenuItem Source #
Methods
Click to display all available methods, including inherited ones
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
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m () |
Emits the activate signal on the given item
deselect
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m () |
Emits the deselect signal on the given item.
getAccelPath
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m (Maybe Text) | Returns: the accelerator path corresponding to
this menu item’s functionality, or |
Retrieve the accelerator path that was previously set on menuItem
.
See menuItemSetAccelPath
for details.
Since: 2.14
getLabel
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m Text | Returns: The text in the |
Sets text
on the menuItem
label
Since: 2.16
getReserveIndicator
menuItemGetReserveIndicator Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the menuItem
reserves space for
the submenu indicator, regardless if it has a submenu
or not.
Since: 3.0
getRightJustified
menuItemGetRightJustified Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 3.2)See menuItemSetRightJustified
Gets whether the menu item appears justified at the right side of the menu bar.
getSubmenu
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m (Maybe Widget) | Returns: submenu for this menu item, or |
Gets the submenu underneath this menu item, if any.
See menuItemSetSubmenu
.
getUseUnderline
menuItemGetUseUnderline Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m Bool | Returns: |
Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.
Since: 2.16
new
:: (HasCallStack, MonadIO m) | |
=> m MenuItem | Returns: the newly created |
Creates a new MenuItem
.
newWithLabel
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m MenuItem | Returns: the newly created |
newWithMnemonic
menuItemNewWithMnemonic Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m MenuItem | Returns: a new |
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
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m () |
Emits the select signal on the given item.
setAccelPath
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Maybe Text |
|
-> 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
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Text |
|
-> m () |
Sets text
on the menuItem
label
Since: 2.16
setReserveIndicator
menuItemSetReserveIndicator Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Bool |
|
-> 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
:: (HasCallStack, MonadIO m, IsMenuItem a, IsMenu b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets or replaces the menu item’s submenu, or removes it when a Nothing
submenu is passed.
setUseUnderline
menuItemSetUseUnderline Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Int32 |
|
-> m () |
Emits the toggleSizeAllocate signal on the given item.
toggleSizeRequest
menuItemToggleSizeRequest Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Int32 |
|
-> m Int32 |
Emits the 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 C_MenuItemActivateCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuItemActivateCallback = IO () Source #
Emitted when the item is activated.
afterMenuItemActivate :: (IsMenuItem a, MonadIO m) => 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
genClosure_MenuItemActivate :: MonadIO m => MenuItemActivateCallback -> m (GClosure C_MenuItemActivateCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuItemActivateCallback :: C_MenuItemActivateCallback -> IO (FunPtr C_MenuItemActivateCallback) Source #
Generate a function pointer callable from C code, from a C_MenuItemActivateCallback
.
noMenuItemActivateCallback :: Maybe MenuItemActivateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuItemActivateCallback
onMenuItemActivate :: (IsMenuItem a, MonadIO m) => 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
wrap_MenuItemActivateCallback :: MenuItemActivateCallback -> C_MenuItemActivateCallback Source #
Wrap a MenuItemActivateCallback
into a C_MenuItemActivateCallback
.
activateItem
type C_MenuItemActivateItemCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 activate.
afterMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => 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
genClosure_MenuItemActivateItem :: MonadIO m => MenuItemActivateItemCallback -> m (GClosure C_MenuItemActivateItemCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuItemActivateItemCallback :: C_MenuItemActivateItemCallback -> IO (FunPtr C_MenuItemActivateItemCallback) Source #
Generate a function pointer callable from C code, from a C_MenuItemActivateItemCallback
.
noMenuItemActivateItemCallback :: Maybe MenuItemActivateItemCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuItemActivateItemCallback
onMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => 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
wrap_MenuItemActivateItemCallback :: MenuItemActivateItemCallback -> C_MenuItemActivateItemCallback Source #
Wrap a MenuItemActivateItemCallback
into a C_MenuItemActivateItemCallback
.
deselect
type C_MenuItemDeselectCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuItemDeselectCallback = IO () Source #
No description available in the introspection data.
afterMenuItemDeselect :: (IsMenuItem a, MonadIO m) => 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
genClosure_MenuItemDeselect :: MonadIO m => MenuItemDeselectCallback -> m (GClosure C_MenuItemDeselectCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuItemDeselectCallback :: C_MenuItemDeselectCallback -> IO (FunPtr C_MenuItemDeselectCallback) Source #
Generate a function pointer callable from C code, from a C_MenuItemDeselectCallback
.
noMenuItemDeselectCallback :: Maybe MenuItemDeselectCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuItemDeselectCallback
onMenuItemDeselect :: (IsMenuItem a, MonadIO m) => 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
wrap_MenuItemDeselectCallback :: MenuItemDeselectCallback -> C_MenuItemDeselectCallback Source #
Wrap a MenuItemDeselectCallback
into a C_MenuItemDeselectCallback
.
select
type C_MenuItemSelectCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuItemSelectCallback = IO () Source #
No description available in the introspection data.
afterMenuItemSelect :: (IsMenuItem a, MonadIO m) => 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
genClosure_MenuItemSelect :: MonadIO m => MenuItemSelectCallback -> m (GClosure C_MenuItemSelectCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuItemSelectCallback :: C_MenuItemSelectCallback -> IO (FunPtr C_MenuItemSelectCallback) Source #
Generate a function pointer callable from C code, from a C_MenuItemSelectCallback
.
noMenuItemSelectCallback :: Maybe MenuItemSelectCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuItemSelectCallback
onMenuItemSelect :: (IsMenuItem a, MonadIO m) => 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
wrap_MenuItemSelectCallback :: MenuItemSelectCallback -> C_MenuItemSelectCallback Source #
Wrap a MenuItemSelectCallback
into a C_MenuItemSelectCallback
.
toggleSizeAllocate
type C_MenuItemToggleSizeAllocateCallback = Ptr () -> Int32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuItemToggleSizeAllocateCallback = Int32 -> IO () Source #
No description available in the introspection data.
afterMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => 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
genClosure_MenuItemToggleSizeAllocate :: MonadIO m => MenuItemToggleSizeAllocateCallback -> m (GClosure C_MenuItemToggleSizeAllocateCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuItemToggleSizeAllocateCallback :: C_MenuItemToggleSizeAllocateCallback -> IO (FunPtr C_MenuItemToggleSizeAllocateCallback) Source #
Generate a function pointer callable from C code, from a C_MenuItemToggleSizeAllocateCallback
.
noMenuItemToggleSizeAllocateCallback :: Maybe MenuItemToggleSizeAllocateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuItemToggleSizeAllocateCallback
onMenuItemToggleSizeAllocate :: (IsMenuItem a, MonadIO m) => 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
wrap_MenuItemToggleSizeAllocateCallback :: MenuItemToggleSizeAllocateCallback -> C_MenuItemToggleSizeAllocateCallback Source #
toggleSizeRequest
type C_MenuItemToggleSizeRequestCallback = Ptr () -> Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MenuItemToggleSizeRequestCallback = Ptr () -> IO () Source #
No description available in the introspection data.
afterMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => 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
genClosure_MenuItemToggleSizeRequest :: MonadIO m => MenuItemToggleSizeRequestCallback -> m (GClosure C_MenuItemToggleSizeRequestCallback) Source #
Wrap the callback into a GClosure
.
mk_MenuItemToggleSizeRequestCallback :: C_MenuItemToggleSizeRequestCallback -> IO (FunPtr C_MenuItemToggleSizeRequestCallback) Source #
Generate a function pointer callable from C code, from a C_MenuItemToggleSizeRequestCallback
.
noMenuItemToggleSizeRequestCallback :: Maybe MenuItemToggleSizeRequestCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MenuItemToggleSizeRequestCallback
onMenuItemToggleSizeRequest :: (IsMenuItem a, MonadIO m) => 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