WoWInterface - View Single Post - Can you name a frame AFTER it's been created?
View Single Post
08-17-19, 10:57 AM   #5
A Warpwood Thunder Caller
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
Originally Posted by Fizzlemizz View Post
The _G[] isn't required unless you're looking up the frame name as a string.

local f = Createframe("Frame", "FizzleFrameX", UIParent)
FizzleFrameX.Texture = FizzleFrameX:CreateTexture()
(fixed a typo for you)
I'm not sure I understand what you said. I mean, in the example you gave, you could equally do:
Lua Code:
  1. local f = Createframe("Frame", "FizzleFrameX", UIParent)
  2. f.Texture = f:CreateTexture()
In any case, me wanting the frame to be globally accessible doesn't have anything to do with the addon's normal operation. It's a personal addon, whose frames' positions and geometries I may sometimes change in the code (which I haven't in a long time, but that's beyond the point). Instead of coding the changes in the addon and then reloading the UI to check it out, I like to do /run frame:SetPoint(...), /run frame:SetWidth(...), etc, right there on the console. That's it.
  Reply With Quote