diff --git a/Button.md b/Button.md index 0abd3ce..06ced05 100644 --- a/Button.md +++ b/Button.md @@ -20,3 +20,14 @@ local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- ```` **args:** text
**returns:** the object
+ +# 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() +```` \ No newline at end of file