gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.MenuComboToolbar.MenuItem

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes
- Signals

Description

The widget used for item in menus

Synopsis

- data MenuItem
- class BinClass o => MenuItemClass o
- castToMenuItem :: GObjectClass obj => obj -> MenuItem
- gTypeMenuItem :: GType
- toMenuItem :: MenuItemClass o => o -> MenuItem
- menuItemNew :: IO MenuItem
- menuItemNewWithLabel :: GlibString string => string -> IO MenuItem
- menuItemNewWithMnemonic :: GlibString string => string -> IO MenuItem
- menuItemSetLabel :: (MenuItemClass self, GlibString string) => self -> string -> IO ()
- menuItemGetLabel :: (MenuItemClass self, GlibString string) => self -> IO string
- menuItemSetUseUnderline :: MenuItemClass self => self -> Bool -> IO ()
- menuItemGetUseUnderline :: MenuItemClass self => self -> IO Bool
- menuItemSetSubmenu :: (MenuItemClass self, MenuClass submenu) => self -> submenu -> IO ()
- menuItemGetSubmenu :: MenuItemClass self => self -> IO (Maybe Widget)
- menuItemRemoveSubmenu :: MenuItemClass self => self -> IO ()
- menuItemEmitSelect :: MenuItemClass self => self -> IO ()
- menuItemEmitDeselect :: MenuItemClass self => self -> IO ()
- menuItemEmitActivate :: MenuItemClass self => self -> IO ()
- menuItemSetRightJustified :: MenuItemClass self => self -> Bool -> IO ()
- menuItemGetRightJustified :: MenuItemClass self => self -> IO Bool
- menuItemSetAccelPath :: (MenuItemClass self, GlibString string) => self -> Maybe string -> IO ()
- menuItemSubmenu :: (MenuItemClass self, MenuClass submenu) => ReadWriteAttr self (Maybe Widget) submenu
- menuItemRightJustified :: MenuItemClass self => Attr self Bool
- menuItemLabel :: (MenuItemClass self, GlibString string) => Attr self string
- menuItemUseUnderline :: MenuItemClass self => Attr self Bool
- menuItemActivatedItem :: MenuItemClass self => Signal self (IO ())
- menuItemActivated :: MenuItemClass self => Signal self (IO ())
- menuItemActivateItem :: MenuItemClass self => Signal self (IO ())
- menuItemActivate :: MenuItemClass self => Signal self (IO ())
- menuItemSelect :: MenuItemClass i => Signal i (IO ())
- menuItemDeselect :: MenuItemClass i => Signal i (IO ())
- menuItemToggle :: MenuItemClass i => Signal i (IO ())

# Detail

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 it derives from `Bin` it can hold any valid child widget, although only a few are really useful.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Bin
    | +----Item
    | +----MenuItem
    | +----CheckMenuItem
    | +----ImageMenuItem
    | +----SeparatorMenuItem
    | +----TearoffMenuItem

# Types

data MenuItem Source #

#### Instances

Instances details

Eq MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: MenuItem -> MenuItem -> Bool Source # (/=) :: MenuItem -> MenuItem -> Bool Source #
Ord MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods compare :: MenuItem -> MenuItem -> Ordering Source # (<) :: MenuItem -> MenuItem -> Bool Source # (<=) :: MenuItem -> MenuItem -> Bool Source # (>) :: MenuItem -> MenuItem -> Bool Source # (>=) :: MenuItem -> MenuItem -> Bool Source # max :: MenuItem -> MenuItem -> MenuItem Source # min :: MenuItem -> MenuItem -> MenuItem Source #
GObjectClass MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: MenuItem -> GObject Source # unsafeCastGObject :: GObject -> MenuItem Source #
BinClass MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ContainerClass MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuItemClass MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class BinClass o => MenuItemClass o Source #

#### Instances

Instances details

MenuItemClass CheckMenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuItemClass ImageMenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuItemClass MenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuItemClass RadioMenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuItemClass SeparatorMenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuItemClass TearoffMenuItem Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToMenuItem :: GObjectClass obj => obj -> MenuItem Source #

gTypeMenuItem :: GType Source #

toMenuItem :: MenuItemClass o => o -> MenuItem Source #

# Constructors

menuItemNew :: IO MenuItem Source #

Creates a new `MenuItem`.

menuItemNewWithLabel Source #

Arguments

:: GlibString string |
=> string | `label` - the text for the label
-> IO MenuItem |

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

menuItemNewWithMnemonic Source #

Arguments

:: GlibString string |
=> string | `label` - The text of the label, with an underscore in front of the mnemonic character
-> IO 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.

# Methods

menuItemSetLabel :: (MenuItemClass self, GlibString string) => self -> string -> IO () Source #

Sets text on the MenuItem label

menuItemGetLabel :: (MenuItemClass self, GlibString string) => self -> IO string Source #

Gets text on the MenuItem label

menuItemSetUseUnderline :: MenuItemClass self => self -> Bool -> IO () Source #

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

menuItemGetUseUnderline :: MenuItemClass self => self -> IO Bool Source #

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

menuItemSetSubmenu :: (MenuItemClass self, MenuClass submenu) => self -> submenu -> IO () Source #

Sets the item's submenu, or changes it.

menuItemGetSubmenu Source #

Arguments

:: MenuItemClass self |
=> self |
-> IO (Maybe Widget) | returns submenu for this menu item, or `Nothing` if none.

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

menuItemRemoveSubmenu :: MenuItemClass self => self -> IO () Source #

Removes the item's submenu.

menuItemEmitSelect :: MenuItemClass self => self -> IO () Source #

Select the menu item. Emits the "select" signal on the item.

menuItemEmitDeselect :: MenuItemClass self => self -> IO () Source #

Deselect the menu item. Emits the "deselect" signal on the item.

menuItemEmitActivate :: MenuItemClass self => self -> IO () Source #

Simulate a click on the menu item. Emits the "activate" signal on the item.

menuItemSetRightJustified Source #

Arguments

:: MenuItemClass self |
=> self |
-> Bool | `rightJustified` - if `True` the menu item will appear at the far right if added to a menu bar.
-> IO () |

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.)

menuItemGetRightJustified :: MenuItemClass self => self -> IO Bool Source #

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

menuItemSetAccelPath Source #

Arguments

:: (MenuItemClass self, GlibString string) |
=> self |
-> Maybe string | `accelPath` - accelerator path, corresponding to this menu item's functionality, or `Nothing` to unset the current path.
-> IO () |

Set the accelerator path on the menu item, 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 setup a default accelerator for this menu item, call `accelMapAddEntry` with the same accel path. 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.

# Attributes

menuItemSubmenu :: (MenuItemClass self, MenuClass submenu) => ReadWriteAttr self (Maybe Widget) submenu Source #

'submenu' property. See `menuItemGetSubmenu` and `menuItemSetSubmenu`

menuItemRightJustified :: MenuItemClass self => Attr self Bool Source #

'rightJustified' property. See `menuItemGetRightJustified` and `menuItemSetRightJustified`

menuItemLabel :: (MenuItemClass self, GlibString string) => Attr self string Source #

'label' property. See `menuItemSetLabel` and `menuItemGetLabel`

menuItemUseUnderline :: MenuItemClass self => Attr self Bool Source #

'useUnderline' property. See `menuItemSetUseUnderline` and `menuItemGetUseEUnderline`

# Signals

menuItemActivatedItem :: MenuItemClass self => Signal self (IO ()) Source #

Emitted when the user chooses a menu item that has a submenu.

- This signal is not emitted if the menu item does not have a submenu.

menuItemActivated :: MenuItemClass self => Signal self (IO ()) Source #

The user has chosen the menu item.

- This is the only function applications normally connect to. It is not emitted if the item has a submenu.

menuItemActivateItem :: MenuItemClass self => Signal self (IO ()) Source #

Deprecated. See `menuItemActivatedItem`.

menuItemActivate :: MenuItemClass self => Signal self (IO ()) Source #

Deprecated. See `menuItemActivated`.

menuItemSelect :: MenuItemClass i => Signal i (IO ()) Source #

This signal is emitted when the item is selected.

menuItemDeselect :: MenuItemClass i => Signal i (IO ()) Source #

This signal is emitted when the item is deselected.

menuItemToggle :: MenuItemClass i => Signal i (IO ()) Source #

This signal is emitted when the item is toggled.