Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
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 C_CheckMenuItemToggledCallback = Ptr () -> Ptr () -> IO ()
- type CheckMenuItemToggledCallback = IO ()
- afterCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => a -> CheckMenuItemToggledCallback -> m SignalHandlerId
- genClosure_CheckMenuItemToggled :: MonadIO m => CheckMenuItemToggledCallback -> m (GClosure C_CheckMenuItemToggledCallback)
- mk_CheckMenuItemToggledCallback :: C_CheckMenuItemToggledCallback -> IO (FunPtr C_CheckMenuItemToggledCallback)
- noCheckMenuItemToggledCallback :: Maybe CheckMenuItemToggledCallback
- onCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => a -> CheckMenuItemToggledCallback -> m SignalHandlerId
- wrap_CheckMenuItemToggledCallback :: CheckMenuItemToggledCallback -> C_CheckMenuItemToggledCallback
Exported types
newtype CheckMenuItem Source #
Memory-managed wrapper type.
Instances
Eq CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem (==) :: CheckMenuItem -> CheckMenuItem -> Bool # (/=) :: CheckMenuItem -> CheckMenuItem -> Bool # | |
IsGValue CheckMenuItem Source # | Convert |
Defined in GI.Gtk.Objects.CheckMenuItem toGValue :: CheckMenuItem -> IO GValue # fromGValue :: GValue -> IO CheckMenuItem # | |
ManagedPtrNewtype CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem | |
TypedObject CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem | |
GObject CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem | |
HasParentTypes CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem | |
type ParentTypes CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem type ParentTypes CheckMenuItem = '[MenuItem, Bin, Container, Widget, Object, ImplementorIface, Actionable, Activatable, Buildable] |
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
Overloaded methods
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 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 C_CheckMenuItemToggledCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> 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
genClosure_CheckMenuItemToggled :: MonadIO m => CheckMenuItemToggledCallback -> m (GClosure C_CheckMenuItemToggledCallback) Source #
Wrap the callback into a GClosure
.
mk_CheckMenuItemToggledCallback :: C_CheckMenuItemToggledCallback -> IO (FunPtr C_CheckMenuItemToggledCallback) Source #
Generate a function pointer callable from C code, from a C_CheckMenuItemToggledCallback
.
noCheckMenuItemToggledCallback :: Maybe CheckMenuItemToggledCallback Source #
A convenience synonym for
.Nothing
:: Maybe
CheckMenuItemToggledCallback
onCheckMenuItemToggled :: (IsCheckMenuItem a, MonadIO m) => 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