PureBasic - Menu
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.
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 OSX 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.