Thread Tools Display Modes
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
12-20-20, 03:49 AM   #2
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
SOLVED.

I only had to declare a variable.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Passing argument to popup menu (UIDropDownMenu)

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off