Posted 20 March 2013 - 07:37 PM
I need help for my OS!! my gui is not working look at this code..
Help ME!! PLEASE
–Vars
build = 3
–Functions
function drawBackgroundDesktop(x, y)
drawBackground = paintutils.loadImage("/gliese/sysfiles/background")
paintutils.drawImage(drawBackground, x, y)
screenX, screenY = term.getSize()
while true do
term.setBackgroundColor(colors.white)
drawBackgroundDesktop(13 ,3)
paintutils.drawLine(1, 1, screenX, 1, colors.blue)
term.setTextColor(colors.black)
term.setCursorPos(1, 1)
print("[Menu]")
local event, button, x, y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if x >=1 and 6 <= x then
if y == 1 then
paintutils.drawLine(1, 1, 6, 1, colors.lightGray)
paintutils.drawLine(1, 2, 8, 2, colors.lightGray)
paintutils.drawLine(1, 3, 8, 4, colors.lightGray)
paintutils.drawLine(1, 4, 8, 4, colors.lightGray)
term.setCursorPos(1, 1)
print("[Menu]")
print("Run")
print("Settings")
print("Taco")
print("Shutdown")
print("Restart")
b = false
local event, button, x, y = os.pullEvent("mouse_click")
if event == "mouse_click" then
if x >= 1 and x <= 8 then
term.setBackgroundColor(colors.white)
term.clear()
paintutils.drawLine(1, 1, screenX, 1, colors.gray)
term.setTextColor(colors.black)
term.setBackgroundColor(colors.white)
if y == 2 then – run
term.setCursorPos(1, 3)
print("Run")
cmd = read()
shell.run(cmd)
elseif y == 3 then
term.setCursorPos(1, 4)
print("Settings")
shell.run("/rom/programs/colors/paint")
elseif y == 4 then
term.setCursorPos(1, 5)
print("Taco")
shell.run("taco")
elseif y == 5 then
term.setCursorPos(1, 6)
print("Shutdown")
os.shutdown()
elseif y == 6 then
term.setCursorPos(1, 7)
print("Restart")
os.reboot()
end
end
end
end
end
end
end
end
Help ME!! PLEASE