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

Contents

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

Description

A base class for menu objects

Synopsis

- data MenuShell
- class ContainerClass o => MenuShellClass o
- castToMenuShell :: GObjectClass obj => obj -> MenuShell
- gTypeMenuShell :: GType
- toMenuShell :: MenuShellClass o => o -> MenuShell
- menuShellAppend :: (MenuShellClass self, MenuItemClass child) => self -> child -> IO ()
- menuShellPrepend :: (MenuShellClass self, MenuItemClass child) => self -> child -> IO ()
- menuShellInsert :: (MenuShellClass self, MenuItemClass child) => self -> child -> Int -> IO ()
- menuShellDeactivate :: MenuShellClass self => self -> IO ()
- menuShellActivateItem :: (MenuShellClass self, MenuItemClass menuItem) => self -> menuItem -> Bool -> IO ()
- menuShellSelectItem :: (MenuShellClass self, MenuItemClass menuItem) => self -> menuItem -> IO ()
- menuShellDeselect :: MenuShellClass self => self -> IO ()
- menuShellSelectFirst :: MenuShellClass self => self -> Bool -> IO ()
- menuShellCancel :: MenuShellClass self => self -> IO ()
- menuShellSetTakeFocus :: MenuShellClass self => self -> Bool -> IO ()
- menuShellGetTakeFocus :: MenuShellClass self => self -> IO Bool
- menuShellTakeFocus :: MenuShellClass self => Attr self Bool
- onActivateCurrent :: MenuShellClass self => self -> (Bool -> IO ()) -> IO (ConnectId self)
- afterActivateCurrent :: MenuShellClass self => self -> (Bool -> IO ()) -> IO (ConnectId self)
- onCancel :: MenuShellClass self => self -> IO () -> IO (ConnectId self)
- afterCancel :: MenuShellClass self => self -> IO () -> IO (ConnectId self)
- onDeactivated :: MenuShellClass self => self -> IO () -> IO (ConnectId self)
- afterDeactivated :: MenuShellClass self => self -> IO () -> IO (ConnectId self)
- data MenuDirectionType
  - = MenuDirParent
  - | MenuDirChild
  - | MenuDirNext
  - | MenuDirPrev
- onMoveCurrent :: MenuShellClass self => self -> (MenuDirectionType -> IO ()) -> IO (ConnectId self)
- afterMoveCurrent :: MenuShellClass self => self -> (MenuDirectionType -> IO ()) -> IO (ConnectId self)
- onSelectionDone :: MenuShellClass self => self -> IO () -> IO (ConnectId self)
- afterSelectionDone :: MenuShellClass self => self -> IO () -> IO (ConnectId self)

# Detail

A `MenuShell` is the abstract base class used to derive the `Menu` and `MenuBar` subclasses.

A `MenuShell` is a container of `MenuItem` objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A `MenuItem` can have a submenu associated with it, allowing for nested hierarchical menus.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----MenuShell
    | +----MenuBar
    | +----Menu

# Types

data MenuShell Source #

#### Instances

Instances details

Eq MenuShell Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: MenuShell -> MenuShell -> Bool Source # (/=) :: MenuShell -> MenuShell -> Bool Source #
Ord MenuShell Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: MenuShell -> MenuShell -> Ordering Source #

(<) :: MenuShell -> MenuShell -> Bool Source #

(<=) :: MenuShell -> MenuShell -> Bool Source #

(>) :: MenuShell -> MenuShell -> Bool Source #

(>=) :: MenuShell -> MenuShell -> Bool Source #

max :: MenuShell -> MenuShell -> MenuShell Source #

min :: MenuShell -> MenuShell -> MenuShell Source #

GObjectClass MenuShell Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: MenuShell -> GObject Source # unsafeCastGObject :: GObject -> MenuShell Source #
ContainerClass MenuShell Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuShellClass MenuShell Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass MenuShell Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class ContainerClass o => MenuShellClass o Source #

#### Instances

Instances details

MenuShellClass Menu Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuShellClass MenuBar Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuShellClass MenuShell Source # |
Instance details Defined in Graphics.UI.Gtk.Types
MenuShellClass RecentChooserMenu Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToMenuShell :: GObjectClass obj => obj -> MenuShell Source #

gTypeMenuShell :: GType Source #

toMenuShell :: MenuShellClass o => o -> MenuShell Source #

# Methods

menuShellAppend Source #

Arguments

:: (MenuShellClass self, MenuItemClass child) |
=> self |
-> child | `child` - The `MenuItem` to add.
-> IO () |

Adds a new `MenuItem` to the end of the menu shell's item list.

menuShellPrepend Source #

Arguments

:: (MenuShellClass self, MenuItemClass child) |
=> self |
-> child | `child` - The `MenuItem` to add.
-> IO () |

Adds a new `MenuItem` to the beginning of the menu shell's item list.

menuShellInsert Source #

Arguments

:: (MenuShellClass self, MenuItemClass child) |
=> self |
-> child | `child` - The `MenuItem` to add.
-> Int | `position` - The position in the item list where `child` is added. Positions are numbered from 0 to n-1.
-> IO () |

Adds a new `MenuItem` to the menu shell's item list at the position indicated by `position`.

menuShellDeactivate :: MenuShellClass self => self -> IO () Source #

Deactivates the menu shell. Typically this results in the menu shell being erased from the screen.

menuShellActivateItem Source #

Arguments

:: (MenuShellClass self, MenuItemClass menuItem) |
=> self |
-> menuItem | `menuItem` - The `MenuItem` to activate.
-> Bool | `forceDeactivate` - If `True`, force the deactivation of the menu shell after the menu item is activated.
-> IO () |

Activates the menu item within the menu shell. If the menu was deactivated and `forceDeactivate` is set, the previously deactivated menu is reactivated.

menuShellSelectItem Source #

Arguments

:: (MenuShellClass self, MenuItemClass menuItem) |
=> self |
-> menuItem | `menuItem` - The `MenuItem` to select.
-> IO () |

Selects the menu item from the menu shell.

menuShellDeselect :: MenuShellClass self => self -> IO () Source #

Deselects the currently selected item from the menu shell, if any.

menuShellSelectFirst Source #

Arguments

:: MenuShellClass self |
=> self |
-> Bool | `searchSensitive` - if `True`, search for the first selectable menu item, otherwise select nothing if the first item isn't sensitive. This should be `False` if the menu is being popped up initially.
-> IO () |

Select the first visible or selectable child of the menu shell; don't select tearoff items unless the only item is a tearoff item.

- Available since Gtk+ version 2.2

menuShellCancel :: MenuShellClass self => self -> IO () Source #

Cancels the selection within the menu shell.

- Available since Gtk+ version 2.4

menuShellSetTakeFocus Source #

Arguments

:: MenuShellClass self |
=> self |
-> Bool | `takeFocus` - `True` if the menu shell should take the keyboard focus on popup.
-> IO () |

If `takeFocus` is `True` (the default) the menu shell will take the keyboard focus so that it will receive all keyboard events which is needed to enable keyboard navigation in menus.

Setting `takeFocus` to `False` is useful only for special applications like virtual keyboard implementations which should not take keyboard focus.

The `takeFocus` state of a menu or menu bar is automatically propagated to submenus whenever a submenu is popped up, so you don't have to worry about recursively setting it for your entire menu hierarchy. Only when programmatically picking a submenu and popping it up manually, the `takeFocus` property of the submenu needs to be set explicitly.

Note that setting it to `False` has side-effects:

If the focus is in some other app, it keeps the focus and keynav in the menu doesn't work. Consequently, keynav on the menu will only work if the focus is on some toplevel owned by the onscreen keyboard.

To avoid confusing the user, menus with `takeFocus` set to `False` should not display mnemonics or accelerators, since it cannot be guaranteed that they will work.

- Available since Gtk+ version 2.8

menuShellGetTakeFocus Source #

Arguments

:: MenuShellClass self |
=> self |
-> IO Bool | returns `True` if the menu shell will take the keyboard focus on popup.

Returns `True` if the menu shell will take the keyboard focus on popup.

- Available since Gtk+ version 2.8

# Attributes

menuShellTakeFocus :: MenuShellClass self => Attr self Bool Source #

A boolean that determines whether the menu and its submenus grab the keyboard focus. See `menuShellSetTakeFocus` and `menuShellGetTakeFocus`.

Default value: `True`

# Signals

onActivateCurrent :: MenuShellClass self => self -> (Bool -> IO ()) -> IO (ConnectId self) Source #

This signal is called if an item is activated. The boolean flag `hide` is True whenever the menu will behidden after this action.

afterActivateCurrent :: MenuShellClass self => self -> (Bool -> IO ()) -> IO (ConnectId self) Source #

This signal is called if an item is activated. The boolean flag `hide` is True whenever the menu will behidden after this action.

onCancel :: MenuShellClass self => self -> IO () -> IO (ConnectId self) Source #

This signal will be emitted when a selection is aborted and thus does not lead to an activation. This is in contrast to the `selection` done signal which is always emitted.

afterCancel :: MenuShellClass self => self -> IO () -> IO (ConnectId self) Source #

This signal will be emitted when a selection is aborted and thus does not lead to an activation. This is in contrast to the `selection` done signal which is always emitted.

onDeactivated :: MenuShellClass self => self -> IO () -> IO (ConnectId self) Source #

This signal is sent whenever the menu shell is deactivated (hidden).

afterDeactivated :: MenuShellClass self => self -> IO () -> IO (ConnectId self) Source #

This signal is sent whenever the menu shell is deactivated (hidden).

data MenuDirectionType Source #

From where was a menu item entered?

Constructors

MenuDirParent |
MenuDirChild |
MenuDirNext |
MenuDirPrev |

#### Instances

Instances details

Enum MenuDirectionType Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: MenuDirectionType -> MenuDirectionType Source #

pred :: MenuDirectionType -> MenuDirectionType Source #

toEnum :: Int -> MenuDirectionType Source #

fromEnum :: MenuDirectionType -> Int Source #

enumFrom :: MenuDirectionType -> [MenuDirectionType] Source #

enumFromThen :: MenuDirectionType -> MenuDirectionType -> [MenuDirectionType] Source #

enumFromTo :: MenuDirectionType -> MenuDirectionType -> [MenuDirectionType] Source #

enumFromThenTo :: MenuDirectionType -> MenuDirectionType -> MenuDirectionType -> [MenuDirectionType] Source #

Show MenuDirectionType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> MenuDirectionType -> ShowS Source # show :: MenuDirectionType -> String Source # showList :: [MenuDirectionType] -> ShowS Source #
Eq MenuDirectionType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: MenuDirectionType -> MenuDirectionType -> Bool Source # (/=) :: MenuDirectionType -> MenuDirectionType -> Bool Source #

onMoveCurrent :: MenuShellClass self => self -> (MenuDirectionType -> IO ()) -> IO (ConnectId self) Source #

This signal is emitted for each move the cursor makes.

afterMoveCurrent :: MenuShellClass self => self -> (MenuDirectionType -> IO ()) -> IO (ConnectId self) Source #

This signal is emitted for each move the cursor makes.

onSelectionDone :: MenuShellClass self => self -> IO () -> IO (ConnectId self) Source #

This signal is emitted when the user finished using the menu. Note that this signal is emitted even if no menu item was activated.

afterSelectionDone :: MenuShellClass self => self -> IO () -> IO (ConnectId self) Source #

This signal is emitted when the user finished using the menu. Note that this signal is emitted even if no menu item was activated.