--Desktop
backColor = 1

term.setBackgroundColor(backColor)
term.clear()

slc = 0

function drawDesktop()
bg = paintutils.loadImage("test.nfp")
paintutils.drawImage(bg,3,2)
img = paintutils.loadImage("icon.nfp")
paintutils.drawImage(img,2,3)
img2 = paintutils.loadImage("icon2.nfp")
paintutils.drawImage(img2,2,11)
term.setBackgroundColor(backColor)
term.setTextColor(128)
term.setCursorPos(2,8)
print("nPaintPro")
term.setCursorPos(2,16)
print("Ink")
term.setBackgroundColor(colors.lime)
term.setTextColor(backColor)
term.setCursorPos(1,19)
write(" Start ")
term.setBackgroundColor(colors.blue)
term.setCursorPos(8,19)
write("                                            ")
end
function drawMenu()
term.setBackgroundColor(1)
term.setTextColor(128)
term.setCursorPos(1,18)
print("          ")
term.setCursorPos(1,17)
print(" Reboot   ")
term.setCursorPos(1,16)
print(" Shutdown ")
term.setCursorPos(1,15)
print("          ")
term.setBackgroundColor(colors.blue)
term.setTextColor(1)
term.setCursorPos(1,14)
print("   User   ")
end
drawDesktop()
while true do
local event, button, X, Y = os.pullEvent("mouse_click")
 
  if slc == 0 then  
    if X >=2 and X<=6 and Y== 19 and button ==1 then
    slc = 1
    drawMenu()
    elseif X>=2 and X<=5 and Y>=3 and Y<=7 and button == 1 then
    shell.run("npp.e04")
    shell.run("gui")
    elseif X>=2 and X<=5 and Y>=11 and Y<=15 and button == 1 then
    shell.run("ink.e04")
    shell.run("gui")
    else
    shell.run("gui")
    end
    
      elseif slc == 1 then
        if X>=2 and X<=9 and Y==16 and button ==1 then slc = 0
        os.shutdown()
        elseif X>=2 and X<=7 and Y==17 and button == 1 then slc = 0
        os.reboot()
        else
        shell.run("gui")
        end
  end
end