Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A CheckMenuItem
is a menu item that maintains the state of a boolean
value in addition to a MenuItem
usual role in activating application
code.
A check box indicating the state of the boolean value is displayed
at the left side of the MenuItem
. Activating the MenuItem
toggles the value.
CSS nodes
plain code
menuitem ├── check.left ╰── <child>
GtkCheckMenuItem has a main CSS node with name menuitem, and a subnode with name check, which gets the .left or .right style class.
Synopsis
- newtype CheckMenuItem = CheckMenuItem (ManagedPtr CheckMenuItem)
- class (GObject o, IsDescendantOf CheckMenuItem o) => IsCheckMenuItem o
- toCheckMenuItem :: (MonadIO m, IsCheckMenuItem o) => o -> m CheckMenuItem
- checkMenuItemGetActive :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> m Bool
- checkMenuItemGetDrawAsRadio :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> m Bool
- checkMenuItemGetInconsistent :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> m Bool
- checkMenuItemNew :: (HasCallStack, MonadIO m) => m CheckMenuItem
- checkMenuItemNewWithLabel :: (HasCallStack, MonadIO m) => Text -> m CheckMenuItem
- checkMenuItemNewWithMnemonic :: (HasCallStack, MonadIO m) => Text -> m CheckMenuItem
- checkMenuItemSetActive :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> Bool -> m ()
- checkMenuItemSetDrawAsRadio :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> Bool -> m ()
- checkMenuItemSetInconsistent :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> Bool -> m ()
- checkMenuItemToggled :: (HasCallStack, MonadIO m, IsCheckMenuItem a) => a -> m ()
- constructCheckMenuItemActive :: (IsCheckMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getCheckMenuItemActive :: (MonadIO m, IsCheckMenuItem o) => o -> m Bool
- setCheckMenuItemActive :: (MonadIO m, IsCheckMenuItem o) => o -> Bool -> m ()
- constructCheckMenuItemDrawAsRadio :: (IsCheckMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getCheckMenuItemDrawAsRadio :: (MonadIO m, IsCheckMenuItem o) => o -> m Bool
- setCheckMenuItemDrawAsRadio :: (MonadIO m, IsCheckMenuItem o) => o -> Bool -> m ()
- constructCheckMenuItemInconsistent :: (IsCheckMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o)
- getCheckMenuItemInconsistent :: (MonadIO m, IsCheckMenuItem o) => o -> m Bool
- setCheckMenuItemInconsistent :: (MonadIO m, IsCheckMenuItem o) => o -> Bool -> m ()
- type CheckMenuItemToggledCallback = IO ()
- afterCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => a -> ((?self :: a) => CheckMenuItemToggledCallback) -> m SignalHandlerId
- onCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => a -> ((?self :: a) => CheckMenuItemToggledCallback) -> m SignalHandlerId
Exported types
newtype CheckMenuItem Source #
Memory-managed wrapper type.
CheckMenuItem (ManagedPtr CheckMenuItem) |
Instances
class (GObject o, IsDescendantOf CheckMenuItem o) => IsCheckMenuItem o Source #
Type class for types which can be safely cast to CheckMenuItem
, for instance with toCheckMenuItem
.
Instances
(GObject o, IsDescendantOf CheckMenuItem o) => IsCheckMenuItem o Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem |
toCheckMenuItem :: (MonadIO m, IsCheckMenuItem o) => o -> m CheckMenuItem Source #
Cast to CheckMenuItem
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
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, toggled, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetFocusChain, unsetStateFlags, watchClosure.
Getters
getAccelPath, getAccessible, getActionGroup, getActionName, getActionTargetValue, getActive, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getBorderWidth, getCanDefault, getCanFocus, getChild, getChildRequisition, getChildVisible, getChildren, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getDrawAsRadio, getEvents, getFocusChain, getFocusChild, getFocusHadjustment, getFocusOnClick, getFocusVadjustment, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInconsistent, 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, setActive, setAllocation, setAppPaintable, setBorderWidth, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDetailedActionName, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setDrawAsRadio, setEvents, setFocusChain, setFocusChild, setFocusHadjustment, setFocusOnClick, setFocusVadjustment, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setInconsistent, 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.
getActive
checkMenuItemGetActive Source #
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the check menu item is active. See gtk_check_menu_item_set_active ().
getDrawAsRadio
checkMenuItemGetDrawAsRadio Source #
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> m Bool | Returns: Whether |
Returns whether checkMenuItem
looks like a RadioMenuItem
Since: 2.4
getInconsistent
checkMenuItemGetInconsistent Source #
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> m Bool | Returns: |
Retrieves the value set by checkMenuItemSetInconsistent
.
new
:: (HasCallStack, MonadIO m) | |
=> m CheckMenuItem | Returns: a new |
Creates a new CheckMenuItem
.
newWithLabel
checkMenuItemNewWithLabel Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m CheckMenuItem | Returns: a new |
Creates a new CheckMenuItem
with a label.
newWithMnemonic
checkMenuItemNewWithMnemonic Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m CheckMenuItem | Returns: a new |
Creates a new CheckMenuItem
containing a label. The label
will be created using labelNewWithMnemonic
, so underscores
in label
indicate the mnemonic for the menu item.
setActive
checkMenuItemSetActive Source #
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the active state of the menu item’s check box.
setDrawAsRadio
checkMenuItemSetDrawAsRadio Source #
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether checkMenuItem
is drawn like a RadioMenuItem
Since: 2.4
setInconsistent
checkMenuItemSetInconsistent Source #
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> Bool |
|
-> m () |
If the user has selected a range of elements (such as some text or
spreadsheet cells) that are affected by a boolean setting, and the
current values in that range are inconsistent, you may want to
display the check in an “in between” state. This function turns on
“in between” display. Normally you would turn off the inconsistent
state again if the user explicitly selects a setting. This has to be
done manually, checkMenuItemSetInconsistent
only affects
visual appearance, it doesn’t affect the semantics of the widget.
toggled
:: (HasCallStack, MonadIO m, IsCheckMenuItem a) | |
=> a |
|
-> m () |
Emits the CheckMenuItem::toggled signal.
Properties
active
No description available in the introspection data.
constructCheckMenuItemActive :: (IsCheckMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “active
” property. This is rarely needed directly, but it is used by new
.
getCheckMenuItemActive :: (MonadIO m, IsCheckMenuItem o) => o -> m Bool Source #
Get the value of the “active
” property.
When overloading is enabled, this is equivalent to
get
checkMenuItem #active
setCheckMenuItemActive :: (MonadIO m, IsCheckMenuItem o) => o -> Bool -> m () Source #
Set the value of the “active
” property.
When overloading is enabled, this is equivalent to
set
checkMenuItem [ #active:=
value ]
drawAsRadio
No description available in the introspection data.
constructCheckMenuItemDrawAsRadio :: (IsCheckMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “draw-as-radio
” property. This is rarely needed directly, but it is used by new
.
getCheckMenuItemDrawAsRadio :: (MonadIO m, IsCheckMenuItem o) => o -> m Bool Source #
Get the value of the “draw-as-radio
” property.
When overloading is enabled, this is equivalent to
get
checkMenuItem #drawAsRadio
setCheckMenuItemDrawAsRadio :: (MonadIO m, IsCheckMenuItem o) => o -> Bool -> m () Source #
Set the value of the “draw-as-radio
” property.
When overloading is enabled, this is equivalent to
set
checkMenuItem [ #drawAsRadio:=
value ]
inconsistent
No description available in the introspection data.
constructCheckMenuItemInconsistent :: (IsCheckMenuItem o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “inconsistent
” property. This is rarely needed directly, but it is used by new
.
getCheckMenuItemInconsistent :: (MonadIO m, IsCheckMenuItem o) => o -> m Bool Source #
Get the value of the “inconsistent
” property.
When overloading is enabled, this is equivalent to
get
checkMenuItem #inconsistent
setCheckMenuItemInconsistent :: (MonadIO m, IsCheckMenuItem o) => o -> Bool -> m () Source #
Set the value of the “inconsistent
” property.
When overloading is enabled, this is equivalent to
set
checkMenuItem [ #inconsistent:=
value ]
Signals
toggled
type CheckMenuItemToggledCallback = IO () Source #
This signal is emitted when the state of the check box is changed.
A signal handler can use checkMenuItemGetActive
to discover the new state.
afterCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => a -> ((?self :: a) => CheckMenuItemToggledCallback) -> m SignalHandlerId Source #
Connect a signal handler for the toggled signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
checkMenuItem #toggled 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.
onCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => a -> ((?self :: a) => CheckMenuItemToggledCallback) -> m SignalHandlerId Source #
Connect a signal handler for the toggled signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
checkMenuItem #toggled callback