How can I refresh a menu on the fly?
I have a menu button which is a checkbox and has an arrow. In the submenu, I can chose something. When you do, the check has to be checked in the 'parent' button...
Here is a modified version of a function I wrote for a similar purpose (should work for any menu level):
local function RefreshMenu(menu)
if UIDROPDOWNMENU_OPEN_MENU == menu and DropDownList1:IsShown() then
local menuLevel, frame = UIDROPDOWNMENU_MENU_LEVEL
for level = 2, menuLevel do
frame = _G['DropDownList' .. level]
if not (frame and frame:IsShown()) then
menuLevel = level - 1
break
end
end
CloseDropDownMenus()
if menu.point ~= 'cursor' then
ToggleDropDownMenu(1, nil, menu, menu.relativeTo or 'UIParent')
else
ToggleDropDownMenu(1, nil, menu, 'cursor', menu.xOffset, menu.yOffset)
end
if DropDownList1:IsShown() then
local button, _
for level = 2, menuLevel do
frame = _G['DropDownList' .. level]
_, button = frame:GetPoint()
if button and button.hasArrow then
ToggleDropDownMenu(level, button.value, nil, nil, nil, nil, nil, button)
if frame.numButtons == 0 then
break
end
end
end
return true
end
end
end
That is a different issue and has been longstanding. As long as you don't use "Set Focus" from the menu in unit frames, taint is irrelevant. So many addons use UIDropDownMenu that this isn't really a valid reason for your addon not to use one.
Use any action only doable with default ui drop down menus. Breaks also macros trying to do those things with scripting. Doesn't matter where from those drop down use tries are made, default ui or some addon.
Bug is ok, because so many else have also same bug in their code?
I hope you don't mind I updated your list of button attributes, mainly after spending half an hour trying to figure out how to make the dropdown options not be radio buttons (info.isNotRadio) then realizing your list was outdated :p
This is a bug Blizzard introduced in the latest patch. They added "self:SetFrameLevel(2)" in their OnLoad script for the menu buttons in a menu in their virtual template. Forcefully setting the menu button to framelevel 2, obviously puts the menu buttons BELOW the menu itself, rendering them unclickable.
Does anybody happen to know when Blizzard fixed this?
Just have the function in scope of the array you'll be passing into the EasyMenu function, and assign it to the the func field of whichever entries in the array you want to use it...
Here is a modified version of a function I wrote for a similar purpose (should work for any menu level):
Use any action only doable with default ui drop down menus. Breaks also macros trying to do those things with scripting. Doesn't matter where from those drop down use tries are made, default ui or some addon.
Bug is ok, because so many else have also same bug in their code?
Does anybody happen to know when Blizzard fixed this?
If not i guess its not the end of the world but I was just curious.
Would I be able to pass arguments or would I be ok creating a sub variable that isnt normally used?