How to add click event to a frame
I want to be able to add events to my frame when I left and right click but frames cannot have click events.
So I was wondering if there was a workaround, like an invisible button or something? |
Frames might not have click events, but they have MouseDown and MouseUp, which also let you know which button was pressed.
Lua Code:
|
Thanks man, appreciate it.
|
Your other option would be to make your frame a Button object instead of a Frame object; it won't look any different (unless you also have it inherit from some kind of button template) and users won't be able to tell the difference, but it will support an actual OnClick script. This will only matter if what you want to do on "click" requires a hardware event -- if it does, then you need OnClick; you can't do that stuff in OnMouseDown/OnMouseUp.
|
Thanks phanx, for now the SetScript works perfectly however I'm definitely going to use yours for some others addons I have, thanks.
Also, this is somewhat off topic but does anyone know of an addon or someway to see the resources currently running addons are using? |
|
I use this one:http://www.wowinterface.com/download...tionHouse.html
It may be in the outdated category, but it still works perfectly. |
The event CPU usage tracking portion of the performance monitoring API is broken, FYI. The rest of it is working, though, I think.
|
All times are GMT -6. The time now is 10:28 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI