WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   the arg1 of <OnClick> event (https://www.wowinterface.com/forums/showthread.php?t=2525)

xmlover 11-29-05 11:00 PM

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 ?

Gello 11-30-05 12:42 AM

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)

xmlover 12-01-05 08:39 AM

thanks a lot

it really works


WOWWIKI should fix this small error :)


All times are GMT -6. The time now is 10:41 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI