View Single Post
07-25-17, 02:13 PM   #8
pas06
A Theradrim Guardian
Join Date: Apr 2009
Posts: 62
As i said i am not familiar with that function but what about doing this:
Lua Code:
  1. local function HSelector(self)
  2.     local toSort = {}
  3.    
  4.     for k in pairs(BangCharHateds) do
  5.         toSort[#toSort + 1] = k
  6.     end
  7. table.sort(toSort)
  8.     for i = 1, #toSort do
  9.         local info = UIDropDownMenu_CreateInfo();
  10.         info.text = toSort[i]
  11.         info.value = toSort[i]
  12.         info.func = function() end;
  13.         UIDropDownMenu_AddButton(info);
  14.     end
  15. end
  16.  
  17. local function Initialize_UIDropDownMenu(btn)
  18.     UIDropDownMenu_Initialize(btn, HSelector)
  19.     UIDropDownMenu_SetWidth(btn, 120)
  20.     UIDropDownMenu_SetButtonWidth(btn, 124)
  21.     UIDropDownMenu_SetSelectedID(btn, 1)
  22.     UIDropDownMenu_JustifyText(btn, "LEFT")
  23.  end
  24.  
  25. local dropdown = CreateFrame("Frame", "HSelector", UIParent, "UIDropDownMenuTemplate");
  26. dropdown:SetPoint("CENTER", 0, 0)
  27. dropdown:Show()
  28. Initialize_UIDropDownMenu(dropdown);
  Reply With Quote