Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:API CreateFrame
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Notes == * CreateFrame() was added in 1.10 * The fourth argument, inheritFrame, was added in 1.11 * Frames CANNOT be deleted. Reuse them. * The frame's [[UIHANDLER_OnLoad|OnLoad handler]], which will only exist if inherited, will be executed during the CreateFrame call. Any OnLoad script handlers set after CreateFrame() will not execute; consider adding any non-inherited OnLoad code directly after a CreateFrame call or use XML frames instead. * The returned frame reference is not strictly necessary because you can access frames by their global name if you give them one. For performance reasons, however, it is advised to store frame references in local variables and use those instead of getting frames by their global name. * See also [[API_Frame_SetScript]] to handle OnFunction scripts when not using a template. * The most common uses for this function are: ** Creating anonymous [[Events (API)|event handlers]]. ** Creating anonymous [[Widget handlers|script handlers]]. ** Creating frames on the fly for occasions when you don't know how many frames will be needed. ** Creating infrequently used frames "on demand", for example: config dialogs, raid frames. * Never forget to unset the frames parent, if you want to get rid of a frame. I would suggest to hide the frame via frame:[[API_Region_Hide|Hide]]() and to use frame:[[API_Region_SetParent|SetParent]](nil) afterward (this will remove the frame from its parents child list). If you just hide the frame without this additional step, frames created afterward will get a higher [[FrameLevel|framelevel]] than the hidden one. After a while, you will get frames at maximum [[FrameLevel|framelevel]] which are likely to be drawn in a distorted way (false order caused by equal [[FrameLevel|framelevel]]).
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)