Advertisement
Guest User

Untitled

a guest
Feb 27th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. local gui = require("gui/gui") -- required
  2. local text = require("gui/text")
  3. local button = require("gui/button")
  4.  
  5. local win = gui:new(nil, {text:new(nil, {1,1}, {14,3}, "Hello World!"), button:new(nil, {1,3}, {13,3}, "Quit!")}, {timeout=0.10})
  6.  
  7. while true do
  8.     local events, values = win:read()
  9.     if events == 2 then
  10.         -- The "Quit!" button was pressed.
  11.         term.clear()
  12.         term.setCursorPos(1,1)
  13.         break
  14.     end
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement