Right mouse button clicks on menu buttons
Hello, I have an EasyMenu DropDownMenu and I want to be able to both right and left click on the buttons and handle each button click differently. However, right button clicks are not registered at all and there's no way to even tell the left button has been clicked.
My code is: Code:
local menuFrame = CreateFrame("Frame", "MenuFrame", DropDownButton, "UIDropDownMenuTemplate") Is there any way to register both buttons and distinguish between the two via one of the 2 custom arguments menuList takes? Other than having to implement my own DropDownMenu. Is there perhaps a function than can be hooked to "force" it to recognize both buttons? I'd like to do something like this: Code:
local menuList = { |
Try this to see if any arguments are passed through to your function maybe?
Lua Code:
|
The signature of the function is func(self, arg1, arg2, checked). Arg1 and arg2 are user defined variables and can be literally anything but unlike most OnClick functions, the button state is not passed!
In fact, right button clicks are not recognized at all, meaning, when I right-click a button nothing happens. It only recognizes left-clicks and I'm trying to change that. Each menuList table has a specific signature more on which can be found here: UI Object UIDropDownMenu and EasyMenu |
It can be done, but it's a bit hacky.
First hook the function that creates menu buttons to make sure they're registered for right clicks. (unless you have a reason to use *Down, I'd use *Up instead, as that's what the rest of the UI uses) Code:
local function createFramesHook(numLevels, numButtons) |
That's exactly what I wanted! Thank you, Lombra.
|
All times are GMT -6. The time now is 02:57 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI