Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

Sets a key on the parent to the child object.

Object:SetParentKey(parentKey)

Arguments[]

parentKey
string

Details[]

  • This is similar to the XML parentKey attribute.

Example[]

Sets a hello key on the parent object.

local parent = CreateFrame("Frame")
local f = CreateFrame("Frame", nil, parent)

-- this is equivalent
--f:GetParent().hello = f
f:SetParentKey("hello")

Creates a texture and sets it as a shroom key on the parent object.

local f = CreateFrame("Frame", nil, UIParent)
f:SetPoint("CENTER")
f:SetSize(64, 64)

-- this is equivalent
--f.shroom = f:CreateTexture()
f:CreateTexture():SetParentKey("shroom")

f.shroom:SetAllPoints(f)
f.shroom:SetTexture("interface/icons/inv_mushroom_11")

Patch changes[]

Dragonflight Patch 10.0.0 (2022-10-25): Added.

Advertisement