Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ####### move window #######
- function test()
- while true do
- local event, button, X, Y = os.pullEvent("mouse_drag") -- mouse drag function
- XY = X..","..Y
- if button == 1 then -- window design
- term.setBackgroundColor(8)
- shell.run("clear")
- term.setBackgroundColor(8)
- term.setCursorPos(X-8,Y)
- term.setBackgroundColor(2048)
- write("Test.exe ")
- term.setBackgroundColor(1)
- term.setBackgroundColor(16384)
- write("X") -- close (does not work)
- term.setBackgroundColor(256)
- term.setCursorPos(X-8,Y+1)
- print(" ")
- term.setCursorPos(X-8,Y+2)
- print(" Hello ")
- term.setCursorPos(X-8,Y+3)
- print(" ")
- term.setCursorPos(X-8,Y+4)
- print(" %")
- term.setBackgroundColor(8)
- end
- end
- end
- -- ####### dekstop icon #######
- term.setBackgroundColor(8)
- shell.run("clear")
- term.setCursorPos(5,3)
- term.setBackgroundColor(16384)
- write(" ")
- term.setBackgroundColor(16)
- write(" ")
- term.setBackgroundColor(16384)
- write(" ")
- term.setCursorPos(5,4)
- term.setBackgroundColor(2048)
- write(" ")
- term.setBackgroundColor(1)
- write(" ")
- term.setBackgroundColor(2048)
- write(" ")
- term.setCursorPos(3,5)
- term.setBackgroundColor(8)
- write("Test.exe")
- -- ####### open window #######
- while true do
- local event, btn, mouseX, mouseY = os.pullEvent("mouse_click") -- mouse click function
- if mouseX >= 5 and mouseX <= 7 and mouseY == 3 or mouseX >= 5 and mouseX <= 7 and mouseY == 4 or mouseX >= 3 and mouseX <= 9 and mouseY == 5 then -- icon area
- B = 6
- A = 15
- term.setBackgroundColor(8) -- window design
- shell.run("clear")
- term.setBackgroundColor(8)
- term.setCursorPos(A,B)
- term.setBackgroundColor(2048)
- write("Text.exe ")
- term.setBackgroundColor(1)
- term.setBackgroundColor(16384)
- write("X")
- term.setBackgroundColor(256)
- term.setCursorPos(A,B+1)
- print(" ")
- term.setCursorPos(A,B+2)
- print(" Hello ")
- term.setCursorPos(A,B+3)
- print(" ")
- term.setCursorPos(A,B+4)
- print(" %")
- test()
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement