Seems Blizz finally got around to nixing "this" from their old libraries, which is screwing up my dropdown menus now (they were built off the old templates). So I've been spending the last hour or so trying to figure out how to fix them for "self". I've almost got it, until an option in a dropdown is clicked:
Error:
Code:
Message: Interface\FrameXML\UIDropDownMenu.lua:915: attempt to index local 'filterText' (a nil value)
Time: 09/02/10 00:15:31
Count: 2
Stack: Interface\FrameXML\UIDropDownMenu.lua:915: in function `UIDropDownMenu_SetText'
Interface\FrameXML\UIDropDownMenu.lua:506: in function `UIDropDownMenu_Refresh'
Interface\FrameXML\UIDropDownMenu.lua:561: in function `UIDropDownMenu_SetSelectedValue'
Interface\AddOns\CFM\CFM_GUI.lua:1167: in function `CFM_ToBoxClick'
Interface\AddOns\CFM\CFM_GUI.lua:1019: in function `func'
Interface\FrameXML\UIDropDownMenu.lua:636: in function `UIDropDownMenuButton_OnClick'
[string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>
Locals: frame = CFM_PropFrame {
selectedValue = 0
0 = <userdata>
}
text = "CENTER"
filterText = nil
(*temporary) = "CFM_PropFrameText"
(*temporary) = nil
(*temporary) = "CFM_PropFrame"
(*temporary) = "attempt to index local 'filterText' (a nil value)"
Code:
lua Code:
--[[ RELATIVEPOINT DATA ]]
dm = CreateFrame("Frame", "CFM_ToBox", f, "UIDropDownMenuTemplate")
dm:SetPoint("LEFT", CFM_ToText, "RIGHT", -10, -2)
dm:SetScale(.75)
UIDropDownMenu_SetWidth(dm,105)
UIDropDownMenu_Initialize(dm, CFM_ToDropInit)
function CFM_ToDropInit(self)
local level = level or 1
local info = UIDropDownMenu_CreateInfo()
info.text = "CENTER"
info.value = 0
info.func = function(self) CFM_ToBoxClick(self) end -- LINE 1019
info.owner = self:GetParent()
info.checked = nil
info.icon = nil
UIDropDownMenu_AddButton(info, level)
end
function CFM_ToBoxClick(self)
UIDropDownMenu_SetSelectedValue(self.owner, self.value) -- LINE 1167
if (self.value == 0) then
activeProfile[selFrame].relativePoint = "CENTER"
end
CFM_ApplySettings(selFrame)
end
I've looked for API changes for the drop menus, but haven't seem to find them. The old version still works in live.