View Single Post
03-29-23, 09:18 AM   #3
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,895
That's because the widget type you're "getting" is a Button. Buttons don't have a SetText or Setfont method by default but in some case they are "given" a SetText method to update a FontString they have also been given.
Lua Code:
  1. local Button = CreateFrame("Button", "SomeButton", UIParent)
  2. Button.Text = Button:CreateFontString(GameFontNormal)
  3. Button.Text:SetPoint("CENTER")
  4. function Button:SetText(text)
  5.     self.Text:SetText(text)
  6. end

You can
Code:
Button:SetText("Something")
but you can't
Code:
Button:SetFont(SomeFont)
but you could
Code:
Button.Text:SetFont(SomeFont)
In this case, you need to find the FontString "sub-widget" of GTxtframe you want to effect (like .GreetingText, it may be something other than .Text).
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-29-23 at 10:06 AM.
  Reply With Quote