WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   UIParent HookScript for OnMouseDown not working (https://www.wowinterface.com/forums/showthread.php?t=57902)

jezzi23 04-01-20 06:05 AM

UIParent HookScript for OnMouseDown not working
 
Hey guys.

EDIT: This is for wow classic! (sorry)

I was hoping to use HookScript to handle "OnMouseDown" events for the entire UI globally. If there's a better way to do this, I'd also be interested!

If I use SetScript, it does in fact work for my purpose but it breaks behaviour in the default UI as I imagine it's overwriting an existing "OnMouseDown". So I tried HookScript instead but the event is never handled.

Code:

UIParent:HookScript("OnMouseDown", function(self)
        print("click"); -- doesn't work!
    end)

Code:

UIParent:SetScript("OnMouseDown", function(self)
        print("click"); -- works! but breaks default behaviour...
    end)

Any ideas?

Kanegasi 04-01-20 06:38 AM

8.3 added the events GLOBAL_MOUSE_DOWN and GLOBAL_MOUSE_UP.


All times are GMT -6. The time now is 08:03 PM.

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