Thread Tools Display Modes
04-01-20, 06:05 AM   #1
jezzi23
A Murloc Raider
Join Date: Apr 2020
Posts: 4
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?

Last edited by jezzi23 : 04-01-20 at 06:44 AM.
  Reply With Quote
04-01-20, 06:38 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
8.3 added the events GLOBAL_MOUSE_DOWN and GLOBAL_MOUSE_UP.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » UIParent HookScript for OnMouseDown not working

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