Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create button to show dropdown
- local Dropdownbutton = AIO:CreateFrame("Button", "Dropdownbutton", nil, "UIPanelButtonTemplate")
- Dropdownbutton:SetSize(100, 30)
- Dropdownbutton:SetPoint("CENTER")
- -- Add on click handler
- Dropdownbutton:SetScript("OnClick", AIO:ToFunction("ToggleDropDownMenu(1, nil, Dropdownframe, Dropdownbutton, 0, 0)"))
- -- Create the dropdown menu frame
- local Dropdownframe = AIO:CreateFrame("Frame", "Dropdownframe", Dropdownbutton, "UIDropDownMenuTemplate")
- Dropdownframe:SetPoint("CENTER", Dropdownbutton, "CENTER", 0, 50)
- -- Initialize menu options through a function when sending menu
- local initmenu = [[
- UIDropDownMenu_Initialize(Dropdownframe,
- function()
- info = {};
- info.text = "This is an option in the menu.";
- info.value = "OptionVariable";
- info.func = function() print("Worked I guess") end
- -- can also be done as function() FunctionCalledWhenOptionIsClicked() end;
- -- Add the above information to the options menu as a button.
- UIDropDownMenu_AddButton(info);
- end
- , 'MENU')
- ]]
- Dropdownframe:AddBlock("Function", AIO:ToFunction(initmenu))
- -- Now just send Dropdownbutton
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement