View Single Post
10-06-15, 11:23 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
For visible buttons, you should do two things:

(1) parent them to the UIParent, so they scale correctly and get hidden with Alt-Z, and

(2) additionally inherit from the ActionButtonTemplate so they have all the textures and regions normal action buttons have, saving you the trouble of creating them all by hand, and making your buttons automatically compatible with any functions and addons that work with action buttons.

Code:
local button=CreateFrame("Button", name, UIParent, "ActionButtonTemplate,SecureActionButtonTemplate")
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote