SteamyPotatoes

Untitled

Jun 1st, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. os.unloadAPI("buttons")
  2. os.loadAPI("buttons")
  3.  
  4. local running = true
  5. local guiButtons = {}
  6.  
  7. close = function() running = false end
  8. hideme = function()
  9. buttons.show(guiButtons.buttonSelfHiding, false)
  10. buttons.enable(guiButtons.buttonClose, false)
  11. end
  12. makeitgreen = function()
  13. buttons.setColor(guiButtons.buttonRed, colors.white, colors.lime)
  14. buttons.setText(guiButtons.buttonRed, "Ahem - Problem?")
  15. buttons.show(guiButtons.buttonSelfHiding, true)
  16. buttons.enable(guiButtons.buttonClose, true)
  17. end
  18.  
  19. guiButtons.buttonClose = buttons.register(3, 3, 7, 1, colors.white, colors.lightGray, "Close", close)
  20. guiButtons.buttonSelfHiding = buttons.register(11, 3, 10, 1, colors.white, colors.lightGray, "Hide me!", hideme)
  21. guiButtons.buttonRed = buttons.register(3, 5, 23, 3, colors.white, colors.red, "WTF? A red button?!", makeitgreen)
  22. guiButtons.buttonFunky = buttons.register(3, 9, 11, 1, colors.white, colors.yellow, "Go funky!", gofunky)
  23.  
  24. buttons.draw()
  25. while running do
  26. local eventArray = {os.pullEvent()}
  27. buttons.event(eventArray)
  28. buttons.draw()
  29. end
  30.  
  31. os.unloadAPI("buttons")
Add Comment
Please, Sign In to add comment