Originally Posted by Fizzlemizz
Code:
dm = CreateFrame("FRAME", "SLFG_RoleMenu", panel, "UIDropDownMenuTemplate")
dm:SetPoint("LEFT", SLFG_RoleText, "RIGHT", 0, -2)
UIDropDownMenu_SetWidth(dm, 70)
UIDropDownMenu_Initialize(dm, SLFG_RoleMenu_Init)
If this is the actual order of your code then this is calling SLFG_RoleMenu_Init before the function has been created so I'm guessing there is another version of it somewhere else also global.
|
Confirmed that there is no other SLFG_RoleMenu_init anywhere else, also moved the entire function before the dropdown creation, no change. This is the really odd thing; Here's a snippet from CFM with the exact same setup as my role dropdown and doesn't have this issue. See if you can notice a difference I'm missing (besides the resizing, etc.). The only major difference is that the self.func points to another outside function instead of being constructed locally, which I also set up and tested my current project, no change:
Lua Code:
function SFM_CreatePanel2()
-- snipped
dm = CreateFrame("Frame", "SFM_FromBox", f, "UIDropDownMenuTemplate")
dm:SetPoint("LEFT", SFM_FromText, "RIGHT", -10, -2)
dm:SetScale(.75)
UIDropDownMenu_SetWidth(dm,105)
UIDropDownMenu_Initialize(dm, SFM_FromDropInit)
-- snipped
end
function SFM_FromDropInit(self)
local info = UIDropDownMenu_CreateInfo()
info.text = "CENTER"
info.value = 0
info.func = SFM_FromBoxClick
info.owner = self
info.checked = nil
info.icon = nil
UIDropDownMenu_AddButton(info)
info.text = "TOP"
info.value = 1
info.func = SFM_FromBoxClick
info.owner = self
info.checked = nil
info.icon = nil
UIDropDownMenu_AddButton(info)
-- snipped
end
function SFM_FromBoxClick(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value)
if (self.value == 0) then
activeProfile[selName].point = "CENTER"
elseif (self.value == 1) then
activeProfile[selName].point = "TOP"
elseif (self.value == 2) then
-- snipped
end
SFM_ApplySettings(selName)
end
EDIT: