Thread: DropDown Menus
View Single Post
06-08-14, 06:40 PM   #5
TULOA
A Wyrmkin Dreamwalker
 
TULOA's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 50
Originally Posted by TULOA View Post
If someone can help out with a more direct function running off a table I would appreciate it. I just had one more idea I am going to try and if it works I will post it back here.

Otherwise I will still be looking.
Ok I wiggled something up that I can improve off of:

Following Requires: menuList, SubList with texts in menuList as keys.
Code:
	local info = UIDropDownMenu_CreateInfo()
		
		if level == 1 then
			for a,b in pairs(menuList) do
				info.text = b[1]
				info.hasArrow = b[2]
				
				UIDropDownMenu_AddButton(info, level)
			end
		elseif level == 2 then
			
			for a,b in pairs(menuList[UIDROPDOWNMENU_MENU_VALUE][3]) do
				info.text = b
				info.func = OnClick
				
				UIDropDownMenu_AddButton(info, level)
			end
		end
Edit: Fixed to run off one table.

Last edited by TULOA : 06-08-14 at 06:50 PM.