WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Passing argument to popup menu (UIDropDownMenu) (https://www.wowinterface.com/forums/showthread.php?t=58470)

Zax 12-19-20 03:59 AM

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.

Zax 12-20-20 03:49 AM

SOLVED.

I only had to declare a variable.


All times are GMT -6. The time now is 06:27 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI