-
Notifications
You must be signed in to change notification settings - Fork 40
Button
Robert Jelic edited this page May 19, 2022
·
12 revisions
Buttons are objects, which execute function by clicking on them
The following list is only available to buttons:
Remember button also inherits from object:
Sets the displayed button text
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aButton = mainFrame:addButton("myFirstButton"):setText("Click"):show() -- you could also use :setValue() instead of :setText() - no difference
Arguments: string text
returns: self
Add a onClick event:
local mainFrame = basalt.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
basalt.debug("Left mousebutton got clicked!")
end
end):show()
Thanks for checking out our wiki, join our discord for more help: discord.gg/yM7kndJdJJ