ElioteDropDownMenu

ElioteDropDownMenu

663 Downloads

The biggest diference of this library over the others is that it doesn't create Global functions.

I tried to make it compatible with classic. If you find any bugs, please report. :)

The name of the functions should be the same as Blizzards APIs. (EasyMenu included!)

The following ones are added:

  • UIDropDownMenu_Create(name, parent, ignoreNameConflict): Use this instead of CreateFrame, by default this function will fail if a frame with the same name exists. If ignoreNameConflict is true, it will create the frame anyway, which might make a new unnamed frame!.
  • UIDropDownMenu_GetOrCreate(name, parent): Same as the UIDropDownMenu_Create, but only creates a new frame if it doesn't already exist.

Example of use:

local EDDM = LibStub("ElioteDropDownMenu-1.0")
local myInitFunction = function()
    local t = EDDM.UIDropDownMenu_CreateInfo()
    t.text = "my button!"
    t.notCheckable = true
    EDDM.UIDropDownMenu_AddButton(t)
end
local dropdownFrame = EDDM.UIDropDownMenu_GetOrCreate("MyTtp")
EDDM.UIDropDownMenu_Initialize(dropdownFrame, myInitFunction, "MENU")
EDDM.ToggleDropDownMenu(1, nil, dropdownFrame, "cursor", 3, -3)