m
→Example: Code looks better when it's lined up properly. Also, you missed a variable name, Starlightblunder. :)
(fix frame in SetPoint call) |
m (→Example: Code looks better when it's lined up properly. Also, you missed a variable name, Starlightblunder. :)) |
||
| 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 = "Option 1", func = function() print("You've chosen option 1"); end }, | |||
{ text = "Option 2", func = function() print("You've chosen option 2"); end }, | |||
{ text = "More Options", hasArrow = true, | |||
menuList = { | |||
{ 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") | ||