Advertisement
dlpratte

Untitled

May 26th, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. os.loadAPI("ui")
  2.  
  3. pinScreen = class.class(ui.screen, function(self, monitor)
  4. ui.screen.init(self, monitor)
  5. self.buttons = {}
  6. self.buttons[0] = {"0", 2,15}
  7. self.buttons[1] = {"1", 2,11}
  8. self.buttons[2] = {"2", 9,11}
  9. self.buttons[3] = {"3",16,11}
  10. self.buttons[4] = {"4", 2, 7}
  11. self.buttons[5] = {"5", 9, 7}
  12. self.buttons[6] = {"6",16, 7}
  13. self.buttons[7] = {"7", 2, 3}
  14. self.buttons[8] = {"8", 9, 3}
  15. self.buttons[9] = {"9",16, 3}
  16. self.pin = ""
  17. self.pinDisplayText = "----"
  18.  
  19. for i, v in pairs(self.buttons) do
  20. local button = ui.button(v[1], self:pinClickEvent, i)
  21. button:setPos(v[2], v[3]):setSize(5, 3)
  22. self:addControl(button)
  23. end
  24. end)
  25.  
  26. function pinScreen:pinClickEvent(button)
  27. print(button.tag)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement