Updated Button (markdown)
11
Button.md
11
Button.md
@@ -20,3 +20,14 @@ local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() --
|
|||||||
````
|
````
|
||||||
**args:** text<br>
|
**args:** text<br>
|
||||||
**returns:** the object<br>
|
**returns:** the object<br>
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
Add a onClick event:
|
||||||
|
````lua
|
||||||
|
local mainFrame = CreateFrame("myFirstFrame"):show()
|
||||||
|
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):onClick(function(self,event,button,x,y)
|
||||||
|
if(event=="mouse_click")and(button==1)then
|
||||||
|
NyoUI.debug("Left mousebutton got clicked!")
|
||||||
|
end
|
||||||
|
end):show()
|
||||||
|
````
|
||||||
Reference in New Issue
Block a user