This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DubbelSoftware's profile picture

Windows

Started by DubbelSoftware, 18 July 2017 - 03:42 PM
DubbelSoftware #1
Posted 18 July 2017 - 05:42 PM
I have seen so much Operating Systems, that have a bar on the top or or on the bottom.
But i dont know how to run a shell, program, or something else, without having the bar away.
I dont know how to do this. So can someone give me a example or something. Or explain it.

-DubbelGaming
KingofGamesYami #2
Posted 18 July 2017 - 06:15 PM
Make a window 1 pixel lower with 1 pixel less height than the term.
Edited on 18 July 2017 - 04:15 PM
DubbelSoftware #3
Posted 18 July 2017 - 07:47 PM
Make a window 1 pixel lower with 1 pixel less height than the term.

And that works? So if i spam enter then the top bar wil not away?
I have seen that if i create a window with window.create, then it just overwrite the bar.
Edited on 18 July 2017 - 05:58 PM
KingofGamesYami #4
Posted 18 July 2017 - 08:20 PM
Well, you have to redirect to said window… but yes.

Example:

term.setBackgroundColor( colors.red )
term.clear()
local maxx, maxy = term.getSize()
local win = window.create( term.current(), 1, 2, maxx, maxy - 1 )
term.redirect( win )
shell.run( "shell" )
DubbelSoftware #5
Posted 04 August 2017 - 08:17 PM
Well, you have to redirect to said window… but yes.

Example:

term.setBackgroundColor( colors.red )
term.clear()
local maxx, maxy = term.getSize()
local win = window.create( term.current(), 1, 2, maxx, maxy - 1 )
term.redirect( win )
shell.run( "shell" )

How do i then know do that if i type edit in the shell, that it wil resize to that size that the window have?
I have searched, and i cannot find it.

-DubbelSoftware
Edited on 04 August 2017 - 06:17 PM
KingofGamesYami #6
Posted 04 August 2017 - 09:42 PM
Most programs will use term.getSize() to dynamically adjust their output to fit the window