View Single Post
12-19-20, 03:59 AM   #1
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Passing argument to popup menu (UIDropDownMenu)

Hello,

I'm using a popup menu based on UIDropDownMenuTemplate like this:

Lua Code:
  1. local popupMenuHiddenFrame = CreateFrame("Frame", "hiddenPopupFrame", nil, "UIDropDownMenuTemplate")
  2. popupTitleBtn:SetScript("OnMouseUp", function(self, mouse)
  3.     if (mouse == "LeftButton") then ToggleDropDownMenu(1, nil, popupMenuHiddenFrame, btnName, -20, 1) end
  4. end)
  5. UIDropDownMenu_Initialize(popupMenuHiddenFrame, popupMenuInitialize, "MENU")

It work fine but I would like to pass an argument to my popupMenuInitialize() function, in order to display a dynamic title in the menu, like described in this picture (string "Ygramul" is what I need):


Found at:
https://wow.gamepedia.com/Using_UIDropDownMenu

Of course, I understand how to create a static title in the menu but I'm unable to pass the needed string to make this title dynamic. I don't need submenus, all my menu items are at the same level.
  Reply With Quote