Thread: parent frame...
View Single Post
12-14-10, 06:04 PM   #6
barbol12
A Cyclonian
 
barbol12's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 42
[quote]
Originally Posted by Phanx View Post
Could you be more specific about "doesn't work"? Does your code trigger a Lua error message? What do you expect to happen? What exactly does happen?

Without knowing anything else, I think you may be confused about what SetParent does. It sets the frame's parent, yes, but that has nothing to do with a frame's position, so you shouldn't expect to see any immediate visual change when you reparent a frame. I'm guessing you're trying to do something like this:

pet:SetPoint("BOTTOM", BT4PetButton1, "TOP", 0, 20)
no not at all... heres what i am doing....
local pet = CreateFrame("Frame", nil, UIParent)
pet:SetWidth(317)
pet:SetHeight(24)
pet:SetPoint("BOTTOM", 2, 150)
pet:SetFrameStrata("BACKGROUND")
pet:SetBackdrop({
bgFile = "Interface\\Addons\\textures\\panels.tga",
edgeFile = "Interface\\Addons\\textures\\Stripped.tga",
tile = "false",
tileSize = 1,
edgeSize = 12,
Insets = {left = 1, right = 1, top = 1, bottom = 1}
})
pet:SetBackdropColor(0.1,0.1,0.1,1)
pet:SetBackdropBorderColor(0.1,0.1,0.1,1)
pet:SetParent("BT4PetButton1")
as u can see it has its own position already.. all i am trying to do is get it to only show up, when the pet bar( or the bartender4 pet button 1, in most cases) shows up... and when i have no pet, or no bt4 pet button1 available it is disappeared... im just trying to figure why this isnt working..

when i set
pet:SetParent("BT4PetButton1")
into the table for the frame.. i lose the custom colorings on all my other frames.. and lose a few of them.... but when i take that line away, everything is fine again.
  Reply With Quote