DgsMenuHide
Jump to navigation
Jump to search
This function hides a DGS menu and cleans up any associated submenus.
Syntax
bool dgsMenuHide ( element menu )
Required Arguments
- menu: The DGS menu element to hide
Returns
Returns true if the menu was hidden successfully, false otherwise.
Examples
loadstring(exports.dgs:dgsImportFunction())()-- load functions -- Create a menu local menu = dgsCreateMenu(200, 200, 150, 120, false) dgsMenuAddItem(menu, "New File", "new") dgsMenuAddItem(menu, "Open File", "open") dgsMenuAddSeparator(menu) dgsMenuAddItem(menu, "Exit", "exit") -- Show the menu dgsMenuShow(menu) -- Handle menu selection addEventHandler("onDgsMenuSelect", menu, function(subMenu, uniqueID) if uniqueID == -1 then return end local command = dgsMenuGetItemCommand(source, uniqueID) if command == "exit" then dgsMenuHide(source) outputChatBox("Menu closed!") else outputChatBox("Selected: " .. command) end end, false)