Skip to content

Menu:destroy

Menu:destroy()
This function destroy a menu.

Dependency

M("Menu")

Example

local menu = Menu('Test', {
    float = 'center|middle',
    title = 'Test menu',
    items = {
        {name = 'close',    label = 'Close', type = 'button'},
    }
})

menu:on('item.click', function(item, index)
    if item.name == 'close' then
        menu:destroy()
    end
end)

Improve this documentation