Thread Tools Display Modes
11-29-05, 11:00 PM   #1
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
the arg1 of <OnClick> event

Code:
CODEs in XML

<OnClick>
       MIEasyOpen_Show(arg1);
</OnClick>


CODEs in LUA

function MIEasyOpen_Show(arg1)
	if (arg1 == "RightButton") then
		Frame1:Show();
	elseif (arg1 == "LeftButton") then 
		Frame2:Show();
	end
end
i wanna a button,when i left click it ,it shows Frame2.and shows frame1 when i right click it.

But it seems that the arg1 returns from <OnClick> never check the RightButton of the mouse but only the left button


why?

how to fix it ?
  Reply With Quote
11-30-05, 12:42 AM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Add an <OnLoad> handler to the button:

<OnLoad>
this:RegisterForClicks("LeftButtonUp","RightButtonUp")
</OnLoad>

And it will recognize right button (and pass arg1 as "RightButton" when you right click it)
  Reply With Quote
12-01-05, 08:39 AM   #3
xmlover
A Fallenroot Satyr
Join Date: Oct 2005
Posts: 25
thanks a lot

it really works


WOWWIKI should fix this small error
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » the arg1 of <OnClick> event

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off