Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
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 => IsMenuItem o
- toMenuItem :: (MonadIO m, IsMenuItem o) => o -> m MenuItem
- noMenuItem :: Maybe 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 => Text -> IO (GValueConstruct o)
- getMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> m (Maybe Text)
- setMenuItemAccelPath :: (MonadIO m, IsMenuItem o) => o -> Text -> m ()
- constructMenuItemLabel :: IsMenuItem o => Text -> IO (GValueConstruct o)
- getMenuItemLabel :: (MonadIO m, IsMenuItem o) => o -> m Text
- setMenuItemLabel :: (MonadIO m, IsMenuItem o) => o -> Text -> m ()
- constructMenuItemRightJustified :: IsMenuItem o => Bool -> IO (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, IsMenu a) => a -> IO (GValueConstruct o)
- getMenuItemSubmenu :: (MonadIO m, IsMenuItem o) => o -> m (Maybe Menu)
- setMenuItemSubmenu :: (MonadIO m, IsMenuItem o, IsMenu a) => o -> a -> m ()
- constructMenuItemUseUnderline :: IsMenuItem o => Bool -> IO (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 :: MenuItemActivateCallback -> IO Closure
- 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 :: MenuItemActivateItemCallback -> IO Closure
- 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 :: MenuItemDeselectCallback -> IO Closure
- 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 :: MenuItemSelectCallback -> IO Closure
- 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 :: MenuItemToggleSizeAllocateCallback -> IO Closure
- 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 :: MenuItemToggleSizeRequestCallback -> IO Closure
- 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
GObject MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem gobjectType :: MenuItem -> IO GType # | |
IsImplementorIface MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsObject MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsActionable MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsActivatable MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsBuildable MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsBin MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsContainer MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsMenuItem MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsWidget MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem |
class GObject o => IsMenuItem o Source #
Type class for types which can be safely cast to MenuItem
, for instance with toMenuItem
.
Instances
(GObject a, (UnknownAncestorError MenuItem a :: Constraint)) => IsMenuItem a Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsMenuItem CheckMenuItem Source # | |
Defined in GI.Gtk.Objects.CheckMenuItem | |
IsMenuItem MenuItem Source # | |
Defined in GI.Gtk.Objects.MenuItem | |
IsMenuItem TearoffMenuItem Source # | |
Defined in GI.Gtk.Objects.TearoffMenuItem | |
IsMenuItem SeparatorMenuItem Source # | |
Defined in GI.Gtk.Objects.SeparatorMenuItem | |
IsMenuItem RadioMenuItem Source # | |
Defined in GI.Gtk.Objects.RadioMenuItem | |
IsMenuItem ImageMenuItem Source # | |
Defined in GI.Gtk.Objects.ImageMenuItem |
toMenuItem :: (MonadIO m, IsMenuItem o) => o -> m MenuItem Source #
Methods
activate
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m () |
Emits the MenuItem
::activate
signal on the given item
deselect
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> m () |
Emits the MenuItem
::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 MenuItem
::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 MenuItem
::toggle-size-allocate
signal on the given item.
toggleSizeRequest
menuItemToggleSizeRequest Source #
:: (HasCallStack, MonadIO m, IsMenuItem a) | |
=> a |
|
-> Int32 |
|
-> m Int32 |
Emits the MenuItem
::toggle-size-request
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 => Text -> IO (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 => Text -> IO (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 => Bool -> IO (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, IsMenu a) => a -> IO (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 => Bool -> IO (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 :: MenuItemActivateCallback -> IO Closure Source #
Wrap the callback into a Closure
.
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
MenuItem
::activate
.
afterMenuItemActivateItem :: (IsMenuItem a, MonadIO m) => a -> MenuItemActivateItemCallback -> m SignalHandlerId Source #
Connect a signal handler for the “activate-item
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
menuItem #activateItem callback
genClosure_MenuItemActivateItem :: MenuItemActivateItemCallback -> IO Closure Source #
Wrap the callback into a Closure
.
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 “activate-item
” 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 :: MenuItemDeselectCallback -> IO Closure Source #
Wrap the callback into a Closure
.
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 :: MenuItemSelectCallback -> IO Closure Source #
Wrap the callback into a Closure
.
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 “toggle-size-allocate
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
menuItem #toggleSizeAllocate callback
genClosure_MenuItemToggleSizeAllocate :: MenuItemToggleSizeAllocateCallback -> IO Closure Source #
Wrap the callback into a Closure
.
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 “toggle-size-allocate
” 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 “toggle-size-request
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
menuItem #toggleSizeRequest callback
genClosure_MenuItemToggleSizeRequest :: MenuItemToggleSizeRequestCallback -> IO Closure Source #
Wrap the callback into a Closure
.
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 “toggle-size-request
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
menuItem #toggleSizeRequest callback