bad syntax fix

This commit is contained in:
Samuel Pizette
2022-06-09 11:08:26 -04:00
parent 42f1870475
commit cb98307e44
25 changed files with 296 additions and 296 deletions

View File

@@ -4,7 +4,7 @@ To make this possible the button needs 1 onClick event, 1 onClickUp event and 1
Very interesting sidetip: events can hold multiple functions!<br>
**Example snippet:**
````lua
```lua
local function buttonColoring()
-- here you can add some coloring for your button
end
@@ -13,14 +13,14 @@ local function buttonLogic()
end
local button = mainFrame:addButton("ExampleButton"):show()
button:onClick(buttonColoring):onClick(buttonLogic) -- yes this would work, if not its a bug!
````
```
This means you can create a function wich handles only the coloring side of your button, and if your button also needs some logic you just create your own unique function for that and add it to your button.
With this knowledge we create now a function where we pass a button-object as parameter and this will setup the coloring of our button:
**Example snippet:**
````lua
```lua
local basalt = dofile("basalt.lua")
local mainFrame = basalt.createFrame("mainFrame"):show()
local button = mainFrame:addButton("firstButton"):setPosition(3,3):setSize(12,3):setText("Click me"):setBackground(colors.gray):setForeground(colors.black):show()
@@ -36,6 +36,6 @@ setupButtonColoring(button)
setupButtonColoring(button2)
basalt.autoUpdate()
````
```
Now you've got a function which sets your buttons up.