Overview

The Menu System provides application menus, context menus, and menu bars for user interaction, similar to Windows menu functionality.

Menu Types

  • Menu Bar - Horizontal menu at top of window
  • Context Menu - Right-click popup menu
  • System Menu - Window control menu
  • Dropdown Menu - Menu from menu bar item

Menu Structure

Menu {
    items: MenuItem[]
    style: MenuStyle
}

MenuItem {
    text: string
    action: function
    submenu: Menu (optional)
    shortcut: string (optional)
    enabled: boolean
    checked: boolean (optional)
}

API

  • createMenu() - Create new menu
  • addMenuItem(menu, text, action) - Add item to menu
  • showContextMenu(x, y, menu) - Show context menu
  • setMenuBar(window, menu) - Set window menu bar