Advertisement
Guest User

test_ui.lua

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. local GUI = require('GUI')
  2. local component = require("component")
  3. local term = require("term")
  4. local sides = require("sides")
  5. local colors = require('src.constants.myColors')
  6.  
  7. function log(val)
  8.   if (type(val) == 'table') then
  9.     for k, v in pairs(val) do
  10.       print(k,v)
  11.     end
  12.   elseif (type(val) == 'function') then
  13.     print("Value is a function")
  14.   else
  15.     print(val)
  16.   end
  17. end
  18.  
  19. function split_string(s,d)
  20.   if (d == nil) then
  21.     d = '%s'
  22.   end
  23.  
  24.   local tmp = {}
  25.   local counter = 1
  26.   for p in string.gmatch(s, "([^" .. d .. "]+)") do
  27.     tmp[counter] = p
  28.     counter = counter + 1
  29.   end
  30.   return tmp
  31. end
  32.  
  33. local mainContainer = GUI.fullScreenContainer()
  34. mainContainer:addChild(GUI.panel(1,1,mainContainer.width, mainContainer.height, colors.blue))
  35.  
  36.  
  37.  
  38. mainContainer:drawOnScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement