View Single Post
08-06-13, 10:10 PM   #46
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You need to add this to the very beginning of all your OnClick scripts:

Code:
if pressed then
    return
end
What kgPanels labels "OnClick" actually gets run for both OnMouseDown and OnMouseUp, with a special variable passed to tell your script which event it's running for. If you want it to work like a real OnClick script, you need to ignore the OnMouseDown event, and only respond to the OnMouseUp event, by checking the "pressed" variable. Otherwise, your "OnClick" script gets run twice every time you click -- once when you press the mouse button, and again when you release it.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote