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:SecureHandlerStateTemplate
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!
{{uitech}} '''SecureHandlerStateTemplate''' is one of the SecureHandler templates introduced in [[Patch 3.0]]. Those templates exist in order to allow addon code to execute within a restricted environment, where it may perform protected actions but has access only to a limited subset of the API. SecureHandlerStateTemplate executes snippets whenever any attribute prefixed with "state-" changes value, making it ideal for use in combination with [[SecureStateDriver]]. == Snippets == The handler executes the following snippets in a restricted environment: ; _onstate-''identifier'' (self, stateid, newstate) : The snippet is executed when the "state-''identifier''" attribute changes value; ''identifier'' may be any arbitrary string of one or more characters. :; self : Secure frame handle to the frame. :; stateid : String - ''identifier'' of the changed state. :; newstate : Mixed - new value of the "state-''identifier''" attribute. Note that if the value is not a string, boolean or a number, it'll be replaced with nil -- this a limitation enforced by the restricted environment. == Example == The frame defined in XML below will be shown only if you have a hostile target. Note that the frame also behaves properly in combat, even though it is protected. <Frame name="MyStateFrame" inherits="SecureHandlerStateTemplate" parent="UIParent" protected="true"> <Attributes> <Attribute name="_onstate-foo" value="if newstate == 'show' then self:Show(); else self:Hide(); end" /> </Attributes> <Scripts> <OnLoad> SecureHandler_OnLoad(self); -- Our OnLoad handler overwrites this one, so execute it now. RegisterStateDriver(self, "foo", "[target=target,exists,harm] show; hide"); </OnLoad> </Scripts> <Size x="64" y="64"/> <Anchors><Anchor point="CENTER"/></Anchors> <Layers><Layer level="OVERLAY"> <Texture name="$parentTex" file="Icons\Temp" setAllPoints="true" /> </Layer></Layers> </Frame> {{API Trail Secure}}
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)
Templates used on this page:
Template:API Trail Secure
(
edit
)
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Navbar
(
edit
)
Template:Navbox
(
edit
)
Template:Tcl
(
edit
)
Template:Uitech
(
edit
)