WoW BlueTracker Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
Poster: Wobin at 5/9/2006 11:14:02 AM PDT
Subject: Slouken: Create(Frame
  Texture) behaviour| I'm not sure how these are supposed to behave. If I create a Frame named 'FrameA' then try to create another Frame with the same name, the second Frame is created nameless, and FrameA still points to the original Frame.

However, if I create a Frame named 'FrameA', then Create a Texture named 'FrameA', the newly created texture is now named 'FrameA' and the original frame is rendered nameless.

Is this intended? One way it loses the name on the first object, the other the second one.
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=375851&p=#post375851
 
Poster: slouken at 5/12/2006 5:50:43 PM PDT
Subject: Re: Slouken: Create(Frame
  Texture) behaviour| In 1.11, the global variable will never be overwritten with an object if the variable with the object's name already exists.
The object will still be created, and object:GetName() will return the name given to it, but you'll need to use the returned object to access it, not the global variable name.
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=375851&p=#post377566
Poster: slouken at 5/12/2006 5:50:43 PM PDT
Subject: Re: Slouken: Create(Frame
  Texture) behaviour *edited post*| In 1.11, the global variable will never be overwritten with an object if the variable with the object's name already exists.
The object will still be created, and object:GetName() will return the name given to it, but you'll need to use the returned object to access it, not the global variable name.
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=375851&p=#post377566
Poster: slouken at 5/12/2006 6:35:18 PM PDT
Subject: Re: Slouken: Create(Frame
  Texture) behaviour|

Q u o t e:

local a1 = CreateFrame("Frame","FrameA","UIParent")
a1:SetPoint("CENTER",0,0)
local a2 = CreateFrame("Frame","FrameA","UIParent")
a2:SetPoint("TOPLEFT",0,0)
--a1:GetName() == a2:GetName() ???



Yes, they have the same name, but only a1 == FrameA.


Q u o t e:

local b = CreateFrame("Frame","FrameB","FrameA")
b:SetPoint("CENTER","FrameA","CENTER",0,0)
-- Where is FrameB??
-- What is FrameB's Parent?



FrameB is parented and anchored to a1.
As Iriel mentioned, you could do this to be more clear:
local b = CreateFrame("Frame", "FrameB", a2);
b:SetPoint("CENTER",0,0)

Edit: Oh, you must pass an object as the parent, not a string. Your example creating b would cause it to be created without a parent.

[ post edited by slouken ]

  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=375851&p=#post377581

View all recent official Blue Posts

WoW Blue Tracker: Archiving World of Warcraft Blue Posts
since March 2005
Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
 

Why Ads?