View Single Post
04-25-17, 12:58 AM   #16
Dejablue
A Wyrmkin Dreamwalker
 
Dejablue's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 58
Originally Posted by Fizzlemizz View Post
That's what we're doing.

You may also be having trouble with positioning. If you /fstack over the buttons you'll probably find you have a bunch of "BMUDButton"..xxx buttons positioned over the top of each other.

Edit: Thanks syncrow. You will need to keep a tally rather than just using the last itemCount value for the text.

The recycle code

Lua Code:
  1. local BMUDButton
  2. if not _G["BMUDButton"..name] then -- Button does not exist so create it
  3.     BMUDButton = CreateFrame("Button", "BMUDButton"..name, UIParent, "SecureActionButtonTemplate");
  4.     -- BMUDButton points to a shiney new button
  5. else
  6.     BMUDButton = _G["BMUDButton"..name]
  7.     -- BMUDButton points to the previously created button
  8. end
I understand this. however I do not understand what you put in place of :

-- BMUDButton points to a shiney new button

or

-- BMUDButton points to the previously created button

I get the concept.

What the hell is the syntax?

What you have so far works great. But once I have a button and use it and no longer have the beacons, the button persists. No event will remove it. Any ideas?
  Reply With Quote