Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Import libraries
- local GUI = require("GUI")
- local system = require("System")
- local color = require("color")
- ---------------------------------------------------------------------------------
- -- Set background color
- local backgroundColor = color.RGBToInteger(28, 28, 28)
- -- Add a new window to MineOS workspace
- local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, backgroundColor))
- -- Get localization table dependent of current system language
- local localization = system.getCurrentScriptLocalization()
- local comboBox = window:addChild(GUI.comboBox(newWidth/3, newHeight/2, 30, 3, 0xEEEEEE, 0x2D2D2D, 0xCCCCCC, 0x888888))
- local Line = window:addChild(GUI.input(newWidth/3, newHeight/2+4, 25, 3, 0xEEEEEE, 0x555555, 0x999999, 0xFFFFFF, 0x2D2D2D))
- local regularButton = window:addChild(GUI.button(newWidth/3+25, newHeight/2+4, 5, 3, 0xFFFFFF, 0x555555, 0x880000, 0xFFFFFF, "+"))
- regularButton.onTouch = function()
- comboBox:addItem(Line.text)
- --filesystem.write("/Whitelist.txt", Line.text)
- end
- -- Customize MineOS menu for this application by your will
- local contextMenu = menu:addContextMenuItem("File")
- contextMenu:addItem("New")
- contextMenu:addSeparator()
- contextMenu:addItem("Open")
- contextMenu:addItem("Save", true)
- contextMenu:addItem("Save as")
- contextMenu:addSeparator()
- contextMenu:addItem("Close").onTouch = function()
- window:remove()
- end
- -- You can also add items without context menu
- menu:addItem("Example item").onTouch = function()
- GUI.alert("It works!")
- end
- -- Create callback function with resizing rules when window changes its' size
- window.onResize = function(newWidth, newHeight)
- window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight
- layout.width, layout.height = newWidth, newHeight
- end
- ---------------------------------------------------------------------------------
- -- Draw changes on screen after customizing your window
- workspace:draw()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement