daily pastebin goal
10%
SHARE
TWEET

t2

a guest Mar 22nd, 2018 154 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("apis/qmain")
  2. os.loadAPI("apis/qformat")
  3. os.loadAPI("apis/qbutton")
  4.  
  5. function screen()
  6.   qbutton.drawButton("one")
  7.   qbutton.drawButton("two")
  8. end
  9.  
  10. function writeText(text)
  11.   monitor.setCursorPos(4,7); monitor.write(text)
  12. end
  13.  
  14. --init
  15. monitor = qmain.setDefaultScreen("top")
  16. monitor.setTextScale(2)
  17. qmain.clear()
  18.  
  19. --test
  20. qbutton.setButton("one", "Click Me!", qbutton.changeButton, {"one", "color", {"d", "f"}}, {2,3}, {11, 3}, {"a", "l"})
  21. qbutton.setButton("two", " ", writeText, {"xd"}, {2, 7}, {1, 1}, {"d", "a"})
  22. screen()
  23.  
  24. while true do
  25.   event, side, x, y = os.pullEvent("monitor_touch")
  26.   if qbutton.clickOn({x, y}) then
  27.     screen()
  28.     break
  29.   end
  30. end
RAW Paste Data
Top