Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.unloadAPI("buttons")
- os.loadAPI("buttons")
- local running = true
- local guiButtons = {}
- close = function() running = false end
- hideme = function()
- buttons.show(guiButtons.buttonSelfHiding, false)
- buttons.enable(guiButtons.buttonClose, false)
- end
- makeitgreen = function()
- buttons.setColor(guiButtons.buttonRed, colors.white, colors.lime)
- buttons.setText(guiButtons.buttonRed, "Ahem - Problem?")
- buttons.show(guiButtons.buttonSelfHiding, true)
- buttons.enable(guiButtons.buttonClose, true)
- end
- guiButtons.buttonClose = buttons.register(3, 3, 7, 1, colors.white, colors.lightGray, "Close", close)
- guiButtons.buttonSelfHiding = buttons.register(11, 3, 10, 1, colors.white, colors.lightGray, "Hide me!", hideme)
- guiButtons.buttonRed = buttons.register(3, 5, 23, 3, colors.white, colors.red, "WTF? A red button?!", makeitgreen)
- guiButtons.buttonFunky = buttons.register(3, 9, 11, 1, colors.white, colors.yellow, "Go funky!", gofunky)
- buttons.draw()
- while running do
- local eventArray = {os.pullEvent()}
- buttons.event(eventArray)
- buttons.draw()
- end
- os.unloadAPI("buttons")
Add Comment
Please, Sign In to add comment