|
Graphics.UI.Port.Menu | Portability | portable | Stability | provisional | Maintainer | ka2_mail@yahoo.com |
|
|
|
|
Contents |
- Menu bar
- Sub menus
- Popup menus
- Menu items
- Common functions
|
|
Description |
The module contains all functions for creation and management of menus.
A menu is a list of items that specify options or groups of options (a submenu).
Clicking a menu item opens a submenu or causes the application to carry out a command.
A menu is arranged in a hierarchy. At the top level of the hierarchy is the menu bar;
which contains a list of menus, which in turn can contain submenus.
|
|
Synopsis |
|
|
|
|
Menu bar |
|
mainMenu :: MenuHandle |
The main application menu (the menu bar) |
|
Sub menus |
|
insertMenu |
|
|
getMenuItemCount :: MenuHandle -> IO Int |
The getMenuItemCount function determines the number of items in the
specified popup or sub menu. |
|
Popup menus |
|
createPopupMenu |
|
|
trackPopupMenu |
:: MenuHandle | The handle of the popup menu | -> WindowHandle | The handle of the window in which to popup the menu | -> Point | The location inside the window at which to display the menu | -> IO () | | The trackPopupMenu function displays a shortcut menu at the specified location in the
window and tracks the selection of items on the menu. |
|
|
Menu items |
|
insertMenuItem :: MenuHandle -> Maybe Int -> IO MenuHandle |
Add a menu item. An event handler for a menu item can be
installed with setMenuCommandHandler. |
|
insertMenuSeparatorItem :: MenuHandle -> Maybe Int -> IO MenuHandle |
Add a menu item separator line. |
|
insertMenuCheckItem :: MenuHandle -> Maybe Int -> IO MenuHandle |
Add a checkable menu item. An event handler for a menu item can be
installed with setMenuCommandHandler. |
|
insertMenuRadioItem :: MenuHandle -> Maybe Int -> IO MenuHandle |
Add a menu radio item. . An event handler for a menu item can be
installed with setMenuCommandHandler. |
|
setMenuRadioGroup :: [MenuHandle] -> IO () |
|
setMenuItemAccel :: MenuHandle -> Key -> IO () |
|
getMenuItemAccel :: MenuHandle -> IO Key |
|
setMenuItemEnabled :: MenuHandle -> Bool -> IO () |
Enable or disable a menu item. |
|
getMenuItemEnabled :: MenuHandle -> IO Bool |
returns True if the menu item is enabled. |
|
setMenuItemChecked :: MenuHandle -> Bool -> IO () |
Check or uncheck a checkable menu item. |
|
getMenuItemChecked :: MenuHandle -> IO Bool |
returns True if the menu item is checked. |
|
setMenuItemBitmap :: MenuHandle -> Maybe Bitmap -> IO () |
|
getMenuItemBitmap :: MenuHandle -> IO (Maybe Bitmap) |
|
Common functions |
|
destroyMenu :: MenuHandle -> IO () |
The destroyMenu function deletes an item from the specified menu. If the menu item opens a menu or submenu,
this function destroys the handle to the menu or submenu and frees the memory used by the menu or submenu. |
|
getMenuItemPos :: MenuHandle -> IO Int |
Returns the position of the item in the parent menu |
|
setMenuLabel :: MenuHandle -> String -> IO () |
Change the label of a menu item (or checkable menu item). |
|
getMenuLabel :: MenuHandle -> IO String |
Returns the label of a menu item (or checkable menu item). |
|
Produced by Haddock version 0.4 |