Fandom

WoWWiki

API Button Click

104,631pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Widget API ← Button < Click

Clicks a button.

MyButton:Click(virtual mouse button)

Arguments Edit

virtual mouse button 
String. The mouse button to virtually click the button with. Whatever gets passed here will be used as arg1 in the button's OnClick script handler.

Example Edit

local f = CreateFrame("Button")
f:SetScript("OnClick", function(self, arg1)
    print(arg1)
end)
f:Click("foo bar") -- will print "foo bar" in the chat frame.
f:Click("blah blah") -- will print "blah blah" in the chat frame.

Notes Edit

  • This does not work on secure buttons.

Also on Fandom

Random Wiki