wasliebob

TouchCalculator

Aug 5th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("top")
  3. m.clear()
  4.  
  5. function fillTable()
  6. button.setTable("1", test1, 10,20,3,5)
  7. button.setTable("2", test2, 22,32,3,5)
  8. button.setTable("3", test3, 10,20,8,10)
  9. button.setTable("4", test4, 22,32,8,10)
  10. button.setTable("5", test4, 10,32,13,15)
  11. button.screen()
  12. end
  13.  
  14. function getClick()
  15. event,side,x,y = os.pullEvent("monitor_touch")
  16. button.checkxy(x,y)
  17. end
  18.  
  19. function test1()
  20. button.flash("Test1")
  21. print("Test1")
  22. end
  23.  
  24. function test2()
  25. button.toggleButton("Test2")
  26. print("Test2")
  27. end
  28.  
  29. function test3()
  30. print("Test3")
  31. end
  32.  
  33. function test4()
  34. print("Test4")
  35. end
  36.  
  37. fillTable()
  38. button.heading("Demo Button Prog")
  39. button.label(1,5,"Demo!")
  40.  
  41. while true do
  42. getClick()
  43. end
Advertisement
Add Comment
Please, Sign In to add comment