Thread Tools Display Modes
02-06-23, 06:25 AM   #1
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 123
Getting UIPanelButtonTemplate texture

I created a SecureActionButtonTemplate in this way

Lua Code:
  1. local main = CreateFrame("Frame", nil, UIParent)
  2. main:SetSize(450, 250)
  3. main:SetPoint("CENTER")
  4. main.button = CreateFrame("Button", nil, main, "SecureActionButtonTemplate")
  5. main.button:SetSize(32, 32)
  6. main.button:SetPoint("CENTER", main, "BOTTOM", 0, 40)
  7. main.button:RegisterForClicks("AnyUp")
  8. main.button:SetAttribute("type", "macro")
  9. main.button:SetAttribute("macrotext", "/stopcasting")

Now I would like to give this button the same texture as the UIPanelButtonTemplate, and maybe even set some text.
How can I do?

Last edited by Benalish : 02-06-23 at 12:24 PM.
  Reply With Quote
02-06-23, 07:41 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Lua Code:
  1. main.button = CreateFrame("Button", nil, main, "SecureActionButtonTemplate, UIPanelButtonTemplate")
  2. main.button:SetText("Yada!")

SecureActionButtonTemplate adds the secure bits, ActionButtonTemplate is the one that makes them look like an action button.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-06-23 at 07:45 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Getting UIPanelButtonTemplate texture


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