Creates a new Frame object


See also Utility functions.

Signature:

frame = CreateFrame("frameType" [, "name" [, parent [, "template"]]])

Arguments:

  • frameType - Type of frame to create; see the widget documentation for details (string)
  • name - Name to assign to the newly created object; used both as the name of the object (retrievable via the GetName method) and as a global variable referencing the object, unless another global by that name already exists (string)
  • parent - Reference to another frame to be the new frame's parent (table)
  • template - Name of a template to be used in creating the frame; if creating a frame from multiple templates, a comma-separated list of names (string)

Returns:

  • frame - A reference to the newly created Frame (table)

Examples:

-- creates a generic button in the middle of the screen
mybutton = CreateFrame("Button","mybutton",UIParent,"UIPanelButtonTemplate")
mybutton:SetPoint("CENTER",0,0)
mybutton:SetWidth(80)
mybutton:SetHeight(22)