wowpedia
Main Menu


Sets a key on the parent to the child object.

Object:SetParentKey(parentKey)

Arguments

parentKey
string

Details

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.