I don't know about the WoW api similarity but I can help you by showing you how i would do it:
First to define some button in you XML (inside <Controls> element, inside <TopLevelControl>):
Code:
<Button name="$(parent)OpenDropdown" inherits="ZO_DropdownButton">
<Anchor .../>
<OnMouseDown>
ToggleMyDropdown(self)
</OnMouseDown>
</Button>
Then in your lua code:
Lua Code:
local hidden = true
function ToggleMyDropdown(control)
hidden = not(hidden)
if hidden then
ClearMenu()
else
ClearMenu()
AddMenuItem("Item1", function() d("item1") end)
AddMenuItem("Item2", function() d("item2") end)
AddMenuItem("Item3", function() d("item3") end)
SetMenuHiddenCallback( function() hidden = true end )
ShowMenu(cotrol,1)
end
end
This is not working example so you should figure out where to put the button, what attributes to set and so on.
Edit:
the GUI section is here already for some time now
Edit2:
added SetMenuHiddenCallback()