WoW:API EasyMenu: Difference between revisions

m
Move page script moved page API EasyMenu to WoW:API EasyMenu without leaving a redirect
(fix frame in SetPoint call)
m (Move page script moved page API EasyMenu to WoW:API EasyMenu without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 19: Line 19:
The following example creates a context menu based on a table description:
The following example creates a context menu based on a table description:
  local menu = {
  local menu = {
  { text = "Select an Option", isTitle = true},
    { text = "Select an Option", isTitle = true},
  { text = "Option 1", func = function() print("You've chosen option 1"); end },
    { text = "Option 1", func = function() print("You've chosen option 1"); end },
  { text = "Option 2", func = function() print("You've chosen option 2"); end },
    { text = "Option 2", func = function() print("You've chosen option 2"); end },
  { text = "More Options", hasArrow = true,
    { text = "More Options", hasArrow = true,
    menuList = {
        menuList = {
    { text = "Option 3", func = function() print("You've chosen option 3"); end }
            { text = "Option 3", func = function() print("You've chosen option 3"); end }
    }  
        }  
  }
    }
  };
  }
  local menuFrame = CreateFrame("Frame", "ExampleMenuFrame", UIParent, "UIDropDownMenuTemplate")
  local menuFrame = CreateFrame("Frame", "ExampleMenuFrame", UIParent, "UIDropDownMenuTemplate")
   
   
Anonymous user