<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://addonstudio.org/mw1/index.php?action=history&amp;feed=atom&amp;title=WoW%3ASecureHandlerClickTemplate</id>
	<title>WoW:SecureHandlerClickTemplate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://addonstudio.org/mw1/index.php?action=history&amp;feed=atom&amp;title=WoW%3ASecureHandlerClickTemplate"/>
	<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlerClickTemplate&amp;action=history"/>
	<updated>2026-05-22T12:41:32Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlerClickTemplate&amp;diff=19225&amp;oldid=prev</id>
		<title>Move page script: Move page script moved page SecureHandlerClickTemplate to WoW:SecureHandlerClickTemplate without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlerClickTemplate&amp;diff=19225&amp;oldid=prev"/>
		<updated>2023-08-15T04:48:56Z</updated>

		<summary type="html">&lt;p&gt;Move page script moved page &lt;a href=&quot;/wiki/WoW:SecureHandlerClickTemplate&quot; title=&quot;WoW:SecureHandlerClickTemplate&quot;&gt;SecureHandlerClickTemplate&lt;/a&gt; to &lt;a href=&quot;/wiki/WoW:SecureHandlerClickTemplate&quot; title=&quot;WoW:SecureHandlerClickTemplate&quot;&gt;SecureHandlerClickTemplate&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:48, 15 August 2023&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key addonstu_asmw2:diff::1.12:old-19224:rev-19225 --&gt;
&lt;/table&gt;</summary>
		<author><name>Move page script</name></author>
	</entry>
	<entry>
		<id>https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlerClickTemplate&amp;diff=19224&amp;oldid=prev</id>
		<title>WoWWiki&gt;Starlightblunder: Created page with &#039;{{uitech}} &#039;&#039;&#039;SecureHandlerClickTemplate&#039;&#039;&#039; is one of the SecureHandler templates introduced in Patch 3.0. Those templates exist in order to allow addon code to execute withi...&#039;</title>
		<link rel="alternate" type="text/html" href="https://addonstudio.org/mw1/index.php?title=WoW:SecureHandlerClickTemplate&amp;diff=19224&amp;oldid=prev"/>
		<updated>2009-06-03T11:46:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;{{uitech}} &amp;#039;&amp;#039;&amp;#039;SecureHandlerClickTemplate&amp;#039;&amp;#039;&amp;#039; is one of the SecureHandler templates introduced in &lt;a href=&quot;/mw1/index.php?title=WoW:Patch_3.0&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WoW:Patch 3.0 (page does not exist)&quot;&gt;Patch 3.0&lt;/a&gt;. Those templates exist in order to allow addon code to execute withi...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{uitech}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SecureHandlerClickTemplate&amp;#039;&amp;#039;&amp;#039; 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. SecureHandlerClickTemplate executes snippets in response to OnClick widget handler invocations.&lt;br /&gt;
&lt;br /&gt;
== Snippets ==&lt;br /&gt;
The handler executes the following snippets in a restricted environment:&lt;br /&gt;
; _onclick (self, button, down) : The snippet is executed when button is clicked.&lt;br /&gt;
:; self : Secure frame handle to the frame being clicked.&lt;br /&gt;
:; button : String - mouse button being clicked (&amp;quot;LeftButton&amp;quot;, ...)&lt;br /&gt;
:; down : Boolean (1/nil) - If true-equivalent, the click is fired by a down-stroke, i.e. the button being pushed down. If false-equivalent, the click is fired by an up-stroke, i.e. the button being released.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Suppose we wanted to make a button that would show/hide multiple protected frames, even while in combat.&lt;br /&gt;
 local frame = CreateFrame(&amp;quot;BUTTON&amp;quot;, &amp;quot;MyClickButton&amp;quot;, UIParent, &amp;quot;SecureHandlerClickTemplate&amp;quot;);&lt;br /&gt;
 frame:SetAttribute(&amp;quot;_onclick&amp;quot;, [=[&lt;br /&gt;
  local show, i, ref = button == &amp;quot;LeftButton&amp;quot;, 2, self:GetFrameRef(&amp;quot;frame1&amp;quot;);&lt;br /&gt;
  while ref do&lt;br /&gt;
   if show then ref:Show(); else ref:Hide(); end&lt;br /&gt;
   i, ref = i + 1, self:GetFrameRef(&amp;quot;frame&amp;quot; .. i);&lt;br /&gt;
  end&lt;br /&gt;
 ]=]); &lt;br /&gt;
 frame:RegisterForClicks(&amp;quot;AnyUp&amp;quot;);&lt;br /&gt;
 frame:SetFrameRef(&amp;quot;frame1&amp;quot;, PlayerFrame);&lt;br /&gt;
 frame:SetFrameRef(&amp;quot;frame2&amp;quot;, TargetFrame);&lt;br /&gt;
 -- ...&lt;br /&gt;
The _onclick snippet would get executed, check whether the click was a left-click, and, based on that, iterate through all &amp;quot;frameX&amp;quot; frame references on the button and show/hide them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{API Trail Secure}}&lt;/div&gt;</summary>
		<author><name>WoWWiki&gt;Starlightblunder</name></author>
	</entry>
</feed>