Skip to main content

Menu

Menu API

Properties

WidgetHasChildren
Menu.MenuBar: Iris.MenuBar

Creates a MenuBar for the current window. Must be called directly under a Window and not within a child widget.

info
This does not create any menus, just tells the window that we going to add menus within.
hasChildren = true
hasState = false
WidgetHasChildrenHasState
Menu.Menu: Iris.Menu

Creates an collapsable menu. If the Menu is created directly under a MenuBar, then the widget will be placed horizontally below the window title. If the menu Menu is created within another menu, then it will be placed vertically alongside MenuItems and display an arrow alongside.

The opened menu will be a vertically listed box below or next to the button.

info

There are widgets which are designed for being parented to a menu whilst other happens to work. There is nothing preventing you from adding any widget as a child, but the behaviour is unexplained and not intended, despite allowed.

hasChildren = true
hasState = true
Arguments = {
    Text: string -- menu text.
}
Events = {
    clicked: () -> boolean,
    opened: () -> boolean, -- once when opened.
    closed: () -> boolean, -- once when closed.
    hovered: () -> boolean
}
States = {
    isOpened: State<boolean>? -- whether the menu is open, including any sub-menus within.
}
Widget
Menu.MenuItem: Iris.MenuItem

Creates a button within a menu. The optional KeyCode and ModiferKey arguments will show the keys next to the title, but will not bind any connection to them. You will need to do this yourself.

hasChildren = false
hasState = false
Arguments = {
    Text: string,
    KeyCode: Enum.KeyCode? = nil, -- an optional keycode, does not actually connect an event.
    ModifierKey: Enum.ModifierKey? = nil -- an optional modifer key for the key code.
}
Events = {
    clicked: () -> boolean,
    hovered: () -> boolean
}
WidgetHasState
Menu.MenuToggle: Iris.MenuToggle

Creates a togglable button within a menu. The optional KeyCode and ModiferKey arguments act the same as the MenuItem. It is not visually the same as a checkbox, but has the same functionality.

hasChildren = false
hasState = true
Arguments = {
    Text: string,
    KeyCode: Enum.KeyCode? = nil, -- an optional keycode, does not actually connect an event.
    ModifierKey: Enum.ModifierKey? = nil -- an optional modifer key for the key code.
}
Events = {
    checked: () -> boolean, -- once on check.
    unchecked: () -> boolean, -- once on uncheck.
    hovered: () -> boolean
}
States = {
    isChecked: State<boolean>?
}
Show raw api
{
    "functions": [],
    "properties": [
        {
            "name": "MenuBar",
            "desc": "Creates a MenuBar for the current window. Must be called directly under a Window and not within a child widget.\n:::info\n    This does not create any menus, just tells the window that we going to add menus within.\n:::\n\n```lua\nhasChildren = true\nhasState = false\n```\n    ",
            "lua_type": "Iris.MenuBar",
            "tags": [
                "Widget",
                "HasChildren"
            ],
            "source": {
                "line": 142,
                "path": "lib/API.lua"
            }
        },
        {
            "name": "Menu",
            "desc": "Creates an collapsable menu. If the Menu is created directly under a MenuBar, then the widget will\nbe placed horizontally below the window title. If the menu Menu is created within another menu, then\nit will be placed vertically alongside MenuItems and display an arrow alongside.\n\nThe opened menu will be a vertically listed box below or next to the button.\n\n:::info\nThere are widgets which are designed for being parented to a menu whilst other happens to work. There is nothing\npreventing you from adding any widget as a child, but the behaviour is unexplained and not intended, despite allowed.\n:::\n\n```lua\nhasChildren = true\nhasState = true\nArguments = {\n    Text: string -- menu text.\n}\nEvents = {\n    clicked: () -> boolean,\n    opened: () -> boolean, -- once when opened.\n    closed: () -> boolean, -- once when closed.\n    hovered: () -> boolean\n}\nStates = {\n    isOpened: State<boolean>? -- whether the menu is open, including any sub-menus within.\n}\n```\n    ",
            "lua_type": "Iris.Menu",
            "tags": [
                "Widget",
                "HasChildren",
                "HasState"
            ],
            "source": {
                "line": 179,
                "path": "lib/API.lua"
            }
        },
        {
            "name": "MenuItem",
            "desc": "Creates a button within a menu. The optional KeyCode and ModiferKey arguments will show the keys next\nto the title, but **will not** bind any connection to them. You will need to do this yourself.\n\n```lua\nhasChildren = false\nhasState = false\nArguments = {\n    Text: string,\n    KeyCode: Enum.KeyCode? = nil, -- an optional keycode, does not actually connect an event.\n    ModifierKey: Enum.ModifierKey? = nil -- an optional modifer key for the key code.\n}\nEvents = {\n    clicked: () -> boolean,\n    hovered: () -> boolean\n}\n```\n    ",
            "lua_type": "Iris.MenuItem",
            "tags": [
                "Widget"
            ],
            "source": {
                "line": 203,
                "path": "lib/API.lua"
            }
        },
        {
            "name": "MenuToggle",
            "desc": "Creates a togglable button within a menu. The optional KeyCode and ModiferKey arguments act the same\nas the MenuItem. It is not visually the same as a checkbox, but has the same functionality.\n\n```lua\nhasChildren = false\nhasState = true\nArguments = {\n    Text: string,\n    KeyCode: Enum.KeyCode? = nil, -- an optional keycode, does not actually connect an event.\n    ModifierKey: Enum.ModifierKey? = nil -- an optional modifer key for the key code.\n}\nEvents = {\n    checked: () -> boolean, -- once on check.\n    unchecked: () -> boolean, -- once on uncheck.\n    hovered: () -> boolean\n}\nStates = {\n    isChecked: State<boolean>?\n}\n```\n    ",
            "lua_type": "Iris.MenuToggle",
            "tags": [
                "Widget",
                "HasState"
            ],
            "source": {
                "line": 232,
                "path": "lib/API.lua"
            }
        }
    ],
    "types": [],
    "name": "Menu",
    "desc": "Menu API\n    ",
    "source": {
        "line": 125,
        "path": "lib/API.lua"
    }
}