fork download
  1. DropDownMenu1 = CreateFrame("Button", "DropDownMenuTest", UIParent, "UIDropDownMenuTemplate")
  2. --write here your code to add some "items" to drop down menu and rest of code
  3. --that is needed to create it correct
  4. DropDownMenu1:RegisterEvent("OnClick")--add on click event to register event
  5. DropDownMenu1:SetScript("OnClick",UploadDropDownMenu2) -- handle function
  6. --UnploadDropDownMenu1 when DropDownMenu1 is pressed
  7.  
  8. DropDownMenu2 = CreateFrame("Button", "DropDownMenuTest2", UIParent, "UIDropDownMenuTemplate")
  9. --write here your code to add some "items" to drop down menu and rest of code
  10. --that is needed to create it correct
  11. DropDownMenu2:RegisterEvent("OnClick")
  12. DropDownMenu2:SetScript("OnClick",UploadDropDownMenu3)--handle function
  13. --UnploadDropDownMenu2 when DropDownMenu1 is pressed
  14.  
  15. DropDownMenu3 = CreateFrame("Button", "DropDownMenuTest3", UIParent, "UIDropDownMenuTemplate")
  16. --write here your code to add some "items" to drop down menu and rest of code
  17. --that is needed to create it correct
  18.  
  19.  
  20.  
  21. local items = {
  22. "Alpha",
  23. "Beta",
  24. "Gamma",
  25. "Delta",
  26. }
  27.  
  28. function UploadDropDownMenu2() -- this function is called when DropDownMenu1 i Clicked
  29. local function initialize(self, level)
  30. local info = this
  31. for k,v in pairs(items) do
  32. info = UIDropDownMenu_CreateInfo()
  33. info.text = v
  34. info.value = v
  35. info.func = OnClick
  36. UIDropDownMenu_AddButton(info, level)
  37. end
  38. end
  39. end
  40.  
  41. function UploadDropDownMenu3()-- this function is called when DropDownMenu12 i Clicked
  42. local function initialize(self, level)
  43. local info = this
  44. for k,v in pairs(items) do
  45. info = UIDropDownMenu_CreateInfo()
  46. info.text = v
  47. info.value = v
  48. info.func = OnClick
  49. UIDropDownMenu_AddButton(info, level)
  50. end
  51. end
  52. end
Runtime error #stdin #stdout #stderr 0.02s 2536KB
stdin
Standard input is empty
stdout

Standard output is empty

stderr
lua: prog.lua:1: attempt to call global 'CreateFrame' (a nil value)
stack traceback:
	prog.lua:1: in main chunk
	[C]: ?