Widget/API/SetScripts

__NOTOC__
Sets a Lua script code snippet for a frame.
MyFrame:SetScripts(scriptType, scriptCode);
== Parameters ==
=== Arguments ===
:;scriptType
::string - Type of code snippet to set (see notes).
:;scriptCode
::string - Lua script code snippet to use.
=== Returns ===
:;None
== Example ==
frame:SetScripts("OnLoad", [=[ SomeFrame.OnLoadHandler() ]=] );
== Notes ==
It is suggested to use Lua's long quote method for defining the Lua script for the code snippet in order to avoid problems with quotes.
Here is a list of known code snippet types for frames
:OnLoad
:OnSizeChanged
:OnEvent
:OnUpdate
:OnShow
:OnHide
:OnEnable
:OnDisable
:OnEnter
:OnLeave
:OnMouseDown
:OnMouseUp
:OnMouseWheel
:OnDragStart
:OnDragStop
:OnReceiveDrag
:OnClick
:OnDoubleClick
:OnValueChanged
:OnUpdateModel
:OnAnimFinished
:OnEnterPressed
:OnEscapePressed
:OnSpacePressed
:OnTabPressed
:OnTextChanged
:OnTextSet
:OnCursorChanged
:OnInputLanguageChanged
:OnEditFocusGained
:OnEditFocusLost
:OnHorizontalScroll
:OnVerticalScroll
:OnScrollRangeChanged
:OnChar
:OnKeyDown
:OnKeyUp
:OnColorSelect
:OnHyperlinkEnter
:OnHyperlinkLeave
:OnHyperlinkClick
:OnMessageScrollChanged
:OnMovieFinished
:OnMovieShowSubtitle
:OnMovieHideSubtitle
:OnTooltipSetDefaultAnchor
:OnTooltipCleared
:OnTooltipAddMoney
Category:Widget/API