Advertisement
Guest User

GUI_Biometric

a guest
Apr 10th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 KB | None | 0 0
  1.  
  2. -- Import libraries
  3. local GUI = require("GUI")
  4. local system = require("System")
  5. local color = require("color")
  6.  
  7. ---------------------------------------------------------------------------------
  8. -- Set background color
  9. local backgroundColor = color.RGBToInteger(28, 28, 28)
  10. -- Add a new window to MineOS workspace
  11. local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, backgroundColor))
  12.  
  13. -- Get localization table dependent of current system language
  14. local localization = system.getCurrentScriptLocalization()
  15.  
  16.  
  17. local comboBox = window:addChild(GUI.comboBox(newWidth/3, newHeight/2, 30, 3, 0xEEEEEE, 0x2D2D2D, 0xCCCCCC, 0x888888))
  18.  
  19. local Line = window:addChild(GUI.input(newWidth/3, newHeight/2+4, 25, 3, 0xEEEEEE, 0x555555, 0x999999, 0xFFFFFF, 0x2D2D2D))
  20.  
  21. local regularButton = window:addChild(GUI.button(newWidth/3+25, newHeight/2+4, 5, 3, 0xFFFFFF, 0x555555, 0x880000, 0xFFFFFF, "+"))
  22. regularButton.onTouch = function()
  23.   comboBox:addItem(Line.text)
  24.   --filesystem.write("/Whitelist.txt", Line.text)
  25. end
  26.  
  27.  
  28.  
  29. -- Customize MineOS menu for this application by your will
  30. local contextMenu = menu:addContextMenuItem("File")
  31. contextMenu:addItem("New")
  32. contextMenu:addSeparator()
  33. contextMenu:addItem("Open")
  34. contextMenu:addItem("Save", true)
  35. contextMenu:addItem("Save as")
  36. contextMenu:addSeparator()
  37. contextMenu:addItem("Close").onTouch = function()
  38.   window:remove()
  39. end
  40.  
  41. -- You can also add items without context menu
  42. menu:addItem("Example item").onTouch = function()
  43.   GUI.alert("It works!")
  44. end
  45.  
  46. -- Create callback function with resizing rules when window changes its' size
  47. window.onResize = function(newWidth, newHeight)
  48.   window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight
  49.   layout.width, layout.height = newWidth, newHeight
  50. end
  51.  
  52. ---------------------------------------------------------------------------------
  53.  
  54. -- Draw changes on screen after customizing your window
  55. workspace:draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement