in your browser.
Unknown errors (LUA code)
Return to board index
Im my addon I have made a frame with a list of different options. Each option is its own frame with its own OnClick handler. I also wanted to add a highlight when you mouseover it so I create a texture to be shown OnEnter and hidden OnLeave.
This showed to be ver hard though..
This is the principle I am using:
for i = 1,5 do
if not helpItem then
--Create the frame and bla bla...
But the very odd thing is that when I do this the only highlight that is show is the last one. And it doesn't matter which of the (in this case 5) frames I mouseover! I added a print(i) to the scripts and as it turn out, it only prints "5" on every frame I enter.
Does anyone know why this happens? Any help is greatly appriciated.
Well this is incorrect, obviously:
helpItem:Hide() <-- not .highlight?
But I can help you out further. All handlers get an argument referring to themselves:
But I can help you out further still. If you set any layered-region (Texture or FontString) to the draw layer "HIGHLIGHT", it will automatically show when you mouseover, and hide when you mouseout, without you needing to do any work manually. So when you do something like:
do this instead:
and exactly what you're trying to accomplish is done for you.
Also, you need to :EnableMouse(true) for mouseover logic to work. Not sure if this includes highlight-regions, but I'm inclined to say it probably does.
You are not logged in. Please
to post a reply or
if you don't already have an account.