View Single Post
09-29-12, 03:31 AM   #12
Animor
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Mar 2011
Posts: 136
Thank you for your answers, people, I appreciate your trying to assist me.
Some users reported to me that this lua error stopped appearing after they removed my addon, so I guess that this is my addon's fault.
I don't want to rewrite my addon using ace3 library just for that, it will take me a lot of time since I'm not very experienced in coding. In fact, this was my first addon (out of two), and when I wrote it, I wasn't even aware of ace3 library.
I use the dropdown in order for the user to choose a font in the config panel, out of a list of 13 fonts. I can narrow it to 8 fonts, but I understood from the answers here that this will not solve the issue.

I will put the relevant code here, perhaps one of the experts will point me to the problem just from reading it.

hebChat.xml:
Code:
<Frame name="$parent_dropDownList" parentKey="dropDownList" inherits="UIDropDownMenuTemplate">
  <Anchors>
    <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$parent_dropDownFont">
      <Offset x="-3" y="-3"/>
    </Anchor>
  </Anchors>
  <Size x="250"/>				
  <Scripts>
    <OnLoad>
      hebChatDropDownList_OnLoad(self)
      UIDropDownMenu_SetWidth(self, 150)
      UIDropDownMenu_SetButtonWidth(self, 174)						
      UIDropDownMenu_JustifyText(self, "CENTER")
    </OnLoad>				
  </Scripts>
</Frame>
hebchat.lua:
Code:
function hebChat.ADDON_LOADED(...)
  UIDropDownMenu_SetText(hebChatConfigPanel.dropDownList, hebChatDB.currentFont)
Code:
function hebChat:globalEn_OnClick(button)
  UIDropDownMenu_Initialize(hebChatConfigPanel.dropDownList, hebChatInitializeDropDown)
  UIDropDownMenu_SetText(hebChatConfigPanel.dropDownList, hebChatDB.currentFont)
Code:
-- Selecting a font from dropdown list
local function hebChatDropDownList_OnClick(self, arg1)
  if (hebChatDB.globalEn) then
    hebChatDB.hebFont		= arg1
    hebChatDB.currentFont	= arg1
  else
    hebChatDB.defaultFont	= arg1
    hebChatDB.currentFont	= arg1	
  end
  hebChat:setChatFont()	
  UIDropDownMenu_SetText(hebChatConfigPanel.dropDownList, hebChatDB.currentFont)
end

-- Initialize fonts dropdown list
local function hebChatInitializeDropDown(self, level)	
  local info = UIDropDownMenu_CreateInfo()	
  for k, v in pairs(hebChat.fonts) do
    wipe (info)
    info.text = k.."   "..v[1]
    --info.keepShownOnClick = true
    --info.isNotRadio = true
    info.arg1 = k
    info.func = hebChatDropDownList_OnClick
    info.checked = hebChatIsCurrentFont(k)
    info.fontObject = hebChat.fObjects[k]		
    UIDropDownMenu_AddButton(info)
  end
end

function hebChatDropDownList_OnLoad(self)
  UIDropDownMenu_Initialize(self, hebChatInitializeDropDown)
end
  Reply With Quote