View Single Post
08-03-16, 09:24 AM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Also, rather than setting generic keys like "unit" on arbitrary frames that don't belong to you (like the UIParent) it's probably better to create an intermediate frame, and parent the RuneFrame to that. Then you don't have to worry about overriding, or being overridden by, other addons or default UI code.

lua Code:
  1. local f = CreateFrame("Frame", "RuneFrameContainer", UIParent)
  2. f:SetSize(130, 18) -- default size of RuneFrame, but doesn't actually matter
  3. f:SetPoint("TOP", UIParent, "CENTER") -- use this to set your desired position
  4.  
  5. f.unit = "player"
  6. -- set any other things the RuneFrame needs here
  7.  
  8. RuneFrame:SetParent(f)
  9. RuneFrame:ClearAllPoints()
  10. RuneFrame:SetPoint("TOP", f) -- position the container, not this
__________________
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.