Gtk2HsContentsIndex
Graphics.UI.Gtk.MenuComboToolbar.Menu
Description

A Menu is a vertically aligned set of options that can be selected. There are two kinds: Those that are part of a MenuBar and those that appear as a context menu (within the work space).

TODO

  • The following not bound functions might be useful: menuSetAccelGroup, menuSetAccelGroup, menuReposition
  • The function menuPopup at a specific position is difficult to bind: The callback function that determines at which position the menu is to be shown is keept after the call returns. Maybe we could destroy this function pointer with a destory event?
Synopsis
data Menu
class MenuShellClass o => MenuClass o
castToMenu :: GObjectClass obj => obj -> Menu
menuNew :: IO Menu
menuReorderChild :: (MenuClass m, MenuItemClass mi) => m -> mi -> Int -> IO ()
menuPopup :: MenuClass m => m -> Event -> IO ()
menuSetAccelGroup :: MenuClass m => m -> AccelGroup -> IO ()
menuGetAccelGroup :: MenuClass m => m -> IO AccelGroup
menuSetAccelPath :: MenuClass m => m -> String -> IO ()
menuSetTitle :: MenuClass m => m -> String -> IO ()
menuGetTitle :: MenuClass m => m -> IO (Maybe String)
menuPopdown :: MenuClass m => m -> IO ()
menuReposition :: MenuClass m => m -> IO ()
menuGetActive :: MenuClass m => m -> IO MenuItem
menuSetActive :: MenuClass m => m -> Int -> IO ()
menuSetTearoffState :: MenuClass m => m -> Bool -> IO ()
menuGetTearoffState :: MenuClass m => m -> IO Bool
menuAttachToWidget :: (MenuClass m, WidgetClass w) => m -> w -> IO ()
menuDetach :: MenuClass m => m -> IO ()
menuGetAttachWidget :: MenuClass m => m -> IO (Maybe Widget)
menuSetScreen :: MenuClass m => m -> Maybe Screen -> IO ()
menuSetMonitor :: MenuClass m => m -> Int -> IO ()
Documentation
data Menu
Instances
MenuClass Menu
MenuShellClass Menu
ContainerClass Menu
WidgetClass Menu
ObjectClass Menu
GObjectClass Menu
class MenuShellClass o => MenuClass o
Instances
MenuClass Menu
castToMenu :: GObjectClass obj => obj -> Menu
menuNew :: IO Menu
Make an empty Menu.
menuReorderChild :: (MenuClass m, MenuItemClass mi) => m -> mi -> Int -> IO ()

Move a child to a new position within the menu.

  • The position is counted from 0 to n-1 if the menu contains n entries.
menuPopup :: MenuClass m => m -> Event -> IO ()
Popup a context menu where a button press occurred.
menuSetAccelGroup :: MenuClass m => m -> AccelGroup -> IO ()
Set the AccelGroup which holds global accelerators for the menu. This accelerator group needs to also be added to all windows that this menu is being used in with windowAddAccelGroup, in order for those windows to support all the accelerators contained in this group.
menuGetAccelGroup :: MenuClass m => m -> IO AccelGroup
Gets the AccelGroup which holds global accelerators for the menu. See menuSetAccelGroup.
menuSetAccelPath :: MenuClass m => m -> String -> IO ()

Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. The main purpose of this function is to spare the programmer the inconvenience of having to call menuItemSetAccelPath on each menu item that should support runtime user changable accelerators. Instead, by just calling menuSetAccelPath on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned.

For example, a menu containing menu items "New" and "Exit", will, after calling

 menu `menuSetAccelPath` "<Gnumeric-Sheet>/File"

assign its items the accel paths: "Gnumeric-Sheet/File/New" and "Gnumeric-Sheet/File/Exit".

Assigning accel paths to menu items then enables the user to change their accelerators at runtime. More details about accelerator paths and their default setups can be found at accelMapAddEntry.

menuSetTitle :: MenuClass m => m -> String -> IO ()
Set the title of the menu. It is displayed if the menu is shown as a tearoff menu.
menuGetTitle :: MenuClass m => m -> IO (Maybe String)
Returns the title of the menu, orNothing if the menu has no title set on it.
menuPopdown :: MenuClass m => m -> IO ()
Remove a context or tearoff menu from the screen.
menuReposition :: MenuClass m => m -> IO ()
Repositions the menu according to its position function.
menuGetActive :: MenuClass m => m -> IO MenuItem
Return the currently selected menu item.
menuSetActive :: MenuClass m => m -> Int -> IO ()
Select the nth item of the menu.
menuSetTearoffState :: MenuClass m => m -> Bool -> IO ()
Specify whether the menu is to be shown as a tearoff menu.
menuGetTearoffState :: MenuClass m => m -> IO Bool
Returns whether the menu is torn off.
menuAttachToWidget :: (MenuClass m, WidgetClass w) => m -> w -> IO ()
Attach this menu to another widget.
menuDetach :: MenuClass m => m -> IO ()
Detach this menu from the widget it is attached to.
menuGetAttachWidget :: MenuClass m => m -> IO (Maybe Widget)
Get the widget this menu is attached to. Returns Nothing if this is a tearoff (context) menu.
menuSetScreen :: MenuClass m => m -> Maybe Screen -> IO ()
Sets the Screen on which the menu will be displayed.
menuSetMonitor
:: MenuClass m
=> m
-> IntThe number of the monitor on which the menu should be popped up
-> IO ()
Informs GTK+ on which monitor a menu should be popped up.
Produced by Haddock version 0.6