Thread Tools Display Modes
09-13-18, 08:43 AM   #1
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Refering to frame called "BagnonBag-3" by its name?

I am working on a modification of Bagnon that allows me to toggle the "Reagents Bank" with an extra menu button instead of having to use the "Reagents Bank" button in the bag list, that I do not need otherwise.

I thought that having my extra menu button trigger the bag list's reagents band button (using Click()) would be the most straight forward method.

But how do I get hold of that button...?
This is how Bagnon is creating its buttons:

Code:
function Bag:New(parent, id)
  local bag = self:Bind(CreateFrame('CheckButton', ADDON .. self.Name .. id, parent))

For bags with a positive id, e.g. 5, I have no problem addressing them like:
Code:
BagnonBag5:Click(button)

Unfortunately, the "Reagents Bank" bag has the id -3 and
Code:
BagnonBag-3:Click(button)
obviously does not work.

So how can I address this button/frame called "BagnonBag-3"??

Thanks
  Reply With Quote
09-13-18, 09:09 AM   #2
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
_G["BagnonBag-3"]
  Reply With Quote
09-13-18, 09:39 AM   #3
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Originally Posted by Vrul View Post
_G["BagnonBag-3"]
Hey, thanks a lot! :-D
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Refering to frame called "BagnonBag-3" by its name?


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