Updated Button (markdown)
@@ -3,7 +3,7 @@ Buttons are objects, which execute function by clicking on them
|
|||||||
Here is a example of how to create a standard button:
|
Here is a example of how to create a standard button:
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = CreateFrame("myFirstFrame"):show()
|
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
||||||
local aButton = mainFrame:addButton("myFirstButton"):show()
|
local aButton = mainFrame:addButton("myFirstButton"):show()
|
||||||
````
|
````
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ Here are all possible functions available for buttons. Remember button inherit f
|
|||||||
## setText
|
## setText
|
||||||
Sets the displayed button text
|
Sets the displayed button text
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = CreateFrame("myFirstFrame"):show()
|
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
||||||
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- you could also use :setValue() instead of :setText() - no difference
|
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- you could also use :setValue() instead of :setText() - no difference
|
||||||
````
|
````
|
||||||
**args:** text<br>
|
**args:** text<br>
|
||||||
@@ -24,7 +24,7 @@ local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() --
|
|||||||
# Examples
|
# Examples
|
||||||
Add a onClick event:
|
Add a onClick event:
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = CreateFrame("myFirstFrame"):show()
|
local mainFrame = NyoUI.createFrame("myFirstFrame"):show()
|
||||||
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):onClick(function(self,event,button,x,y)
|
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):onClick(function(self,event,button,x,y)
|
||||||
if(event=="mouse_click")and(button==1)then
|
if(event=="mouse_click")and(button==1)then
|
||||||
NyoUI.debug("Left mousebutton got clicked!")
|
NyoUI.debug("Left mousebutton got clicked!")
|
||||||
|
|||||||
Reference in New Issue
Block a user