Allows addon authors to add buttons to the game's main menu frame. Buttons may be inserted at any numerical index within the list by calling ExtensibleMainMenu.AddButton(obj|text, position, onClickHandler).
Usage Examples
Example 1:
local addonOptionsButton =
ExtensibleMainMenu.AddButton("My Addon", 7, function()
DEFAULT_CHAT_FRAME:AddMessage("Load options frame for my addon...")
end)
Example 2:
local obj = CreateFrame("BUTTON", nil, nil, "GameMenuButtonTemplate")
obj:SetText("My Addon")
ExtensibleMainMenu.AddButton(obj, 7, function()
DEFAULT_CHAT_FRAME:AddMessage("Load options frame for my addon...")
end)
Addon Definition
Methods
ExtensibleMainMenu.AddButton([text|obj, [position, [onClickHandler]]]) - Adds a button to the main menu. If a table is passed, it's treated as a UI object. If a string or number is passed, it's set as the text of a new button. If nil is passed, it creates a space between the buttons. This function returns a reference to the created (or given) object.