Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu
- local gui = require("gui")
- local prgName = "Gui-lib v"
- local version = gui.Version()
- function exitButtonCallback(guiID, id)
- local result = gui.getYesNo("", "Do you really want to exit?", "")
- if result == true then
- gui.exit()
- end
- gui.displayGui(myGui)
- end
- myGui = gui.newGui(2, 2, 78, 23, true)
- exitbutton = gui.newButton(myGui, "center", 21, "exit", exitButtonCallback)
- label1 = gui.newLabel(myGui, 2, 1, "A label")
- label2 = gui.newLabel(myGui, 2, 3, "A colored label", 0xFF0000, 0xFFFF00)
- frame = gui.newFrame(myGui, 2, 5, 40, 6, "A frame")
- checkbox1 = gui.newCheckbox(myGui, 3, 7, false)
- cbLabel1 = gui.newLabel(myGui, 7, 7, "Checkbox")
- checkbox2 = gui.newCheckbox(myGui, 3, 8, true)
- cbLabel2 = gui.newLabel(myGui, 7, 8, "Second checkbox")
- text = gui.newText(myGui, 2, 12, 25, "Text input")
- progress = gui.newProgress(myGui, 2, 16, 35, 100, 0, nil, true)
- list = gui.newList(myGui, 50, 3, 25, 10, {"Entry 1", "Entry two", "Number 3", "44444"}, nil, "A List")
- vprogress1 = gui.newVProgress(myGui, 44, 3, 10, 100, 0, nil)
- vprogress2 = gui.newVProgress(myGui, 46, 3, 10, 100, 0, nil, 1)
- radioframe = gui.newFrame(myGui, 48, 14, 25, 6)
- radio1 = gui.newRadio(myGui, 50, 15)
- radio2 = gui.newRadio(myGui, 50, 16)
- radio3 = gui.newRadio(myGui, 50, 17)
- radio4 = gui.newRadio(myGui, 50, 18)
- radioLabel1 = gui.newLabel(myGui, 54, 15, "Radio button 1")
- radioLabel2 = gui.newLabel(myGui, 54, 16, "Radio button 2")
- radioLabel3 = gui.newLabel(myGui, 54, 17, "Radio button 3")
- radioLabel4 = gui.newLabel(myGui, 54, 18, "Radio button 4")
- hline = gui.newHLine(myGui, 5, 20, 40)
- gui.clearScreen()
- gui.setTop(prgName .. version)
- local counter = 0
- while true do
- gui.runGui(myGui)
- counter = counter + 1
- if counter <= 100 then
- gui.setValue(myGui, progress, counter)
- gui.setValue(myGui, vprogress1, counter)
- gui.setValue(myGui, vprogress2, counter)
- end
- if counter > 110 then
- counter = 0
- end
- end
Add Comment
Please, Sign In to add comment