Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
Adrian L Lange edited this page Jul 2, 2018 · 7 revisions

Sections:

A test implementation can be found in /tests/dropdown.lua.

Example with a button:

local Menu = LibStub('LibDropDown'):NewButton(UIParent, 'MyMenuButton')
Menu:SetPoint('CENTER', 0, -50)
Menu:SetJustifyH('LEFT')
Menu:SetStyle('MENU') -- can be omitted, defaults to 'DEFAULT'
Menu:SetText('My Dropdown')

Menu:Add({
    checked = true,
    text = 'Line 1',
    args = {'value1', 'value2'}
    func = function(self, button, ...)
        print('click', button, ...)
    end
})

Example menu only:

local Menu = LibStub('LibDropDown'):NewMenu(MyFrame, 'MyFrameDropDown')
Menu:SetAnchor('CENTER', 0, -50)
Menu:SetStyle('MENU') -- can be omitted, defaults to 'DEFAULT'

Menu:Add({
    checked = true,
    text = 'Line 1',
    args = {'value1', 'value2'}
    func = function(self, button, ...)
        print('click', button, ...)
    end
})

Menu:Toggle()
Clone this wiki locally