PureBasic - Menu

Overview

Creating and managing menus in PureBasic is simple. You can, of course, tailor the menus to your specific needs.

To use a menu you must first start by creating one with either CreateMenu() for normal menus, or CreatePopupMenu() for pop-up menus.

macOS:
On OSX an application menu is never attached to a window but always to the desktop. The menu at the top of the desktop shows the items from the application that has focus.
There are predefined menu events #PB_Menu_Quit, #PB_Menu_About and #PB_Menu_Preferences to represent the entries in the application menu which is present on every macOS program. Their values are negative to not conflict with any menu entries defined in the program. They are reported from EventMenu() as regular menu events.

Command Index

BindMenuEvent
CloseSubMenu
CreateImageMenu
CreateMenu
CreatePopupImageMenu
CreatePopupMenu
DisableMenuItem
DisplayPopupMenu
FreeMenu
GetMenuItemState
GetMenuItemText
GetMenuTitleText
HideMenu
IsMenu
MenuBar
MenuHeight
MenuID
MenuItem
MenuTitle
OpenSubMenu
SetMenuItemState
SetMenuItemText
SetMenuTitleText
UnbindMenuEvent

Example

Menu.pb
PopupMenu.pb

Supported OS

All

Reference Manual - Index