Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- now to handle our button clicks!
- os.loadAPI("redbutton")
- local button = redbutton.addButton(
- 5,5,15,2,colors.white,colors.blue,"Click Me!")
- -- now for a while loop for checking click events
- while true do
- -- ok now lets check if our button is pressed
- ev = {os.pullEvent()} -- make sure your event is in a table
- -- now to pass our event table onto our button
- if(redbutton:pressed(ev))then
- -- exit the program if our button was pressed
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement