WoWInterface - View Single Post - HELP: DropdownMenu issue
View Single Post
09-19-19, 08:00 PM   #5
Curse staff
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Fizzlemizz View Post
List of button attributes
info.owner = [Frame]  --  Dropdown frame that "owns" the current dropdownlist
In the following you would want to pass the button, not the buttons owner (self instead of self.owner).

function SLFG_DungeonMenuClick(self)
    UIDropDownMenu_SetSelectedValue(self.owner, self.value)
This is what is already being done in the actual code AFAIK:

Lua Code:
  1. dm = CreateFrame("FRAME", "SLFG_DungeonMenu", panel, "UIDropDownMenuTemplate")
  2.             UIDropDownMenu_Initialize(dm, SLFG_DungeonMenu_Init)  -- passing dm
  4. function SLFG_DungeonMenu_Init(self)  -- self = dm
  5.     local info = UIDropDownMenu_CreateInfo()
  6.         info.owner = self -- info.owner = dm
  7.     end
  8. end

When I edit it to
Lua Code:
  1. UIDropDownMenu_SetSelectedValue(self, self.value)
it errors out.

Like I said, the actual functionality works 100% error free, it's just the list automatically checking themselves.

Last edited by Sythalin : 09-19-19 at 08:20 PM.
  Reply With Quote