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

How to delete a window

Started by Zecradox, 05 July 2018 - 05:47 PM
Zecradox #1
Posted 05 July 2018 - 07:47 PM
.
Luca_S #2
Posted 05 July 2018 - 07:58 PM
If you have not redirected into the window or anything like this you should be able to do this:

win.setVisible(false)
win = nil
Zecradox #3
Posted 05 July 2018 - 08:09 PM
[removed by me, i read your post wrong]
Edited on 05 July 2018 - 06:34 PM
Zecradox #4
Posted 05 July 2018 - 08:36 PM
If you have not redirected into the window or anything like this you should be able to do this:

win.setVisible(false)
win = nil
This doesn't work, even if i redirect out of the window i want to delete
Edited on 05 July 2018 - 06:36 PM
SquidDev #5
Posted 05 July 2018 - 09:08 PM
Generally, both in Ask a Pro and elsewhere, the amount of effort people are willing to put in to answer a question is dependent on how much effort it looks like the asker has put in to forming the question.

What do you mean by delete a window? If you mean hide it and restore what was there already, you can't - you need to keep each drawable region in separate buffers and redraw them.
Edited on 05 July 2018 - 07:09 PM
Zecradox #6
Posted 05 July 2018 - 11:35 PM
Generally, both in Ask a Pro and elsewhere, the amount of effort people are willing to put in to answer a question is dependent on how much effort it looks like the asker has put in to forming the question.

What do you mean by delete a window? If you mean hide it and restore what was there already, you can't - you need to keep each drawable region in separate buffers and redraw them.
There's not much else to say. Delete a window (make it invisible), never to be redrawn.
valithor #7
Posted 06 July 2018 - 03:01 AM
Generally, both in Ask a Pro and elsewhere, the amount of effort people are willing to put in to answer a question is dependent on how much effort it looks like the asker has put in to forming the question.

What do you mean by delete a window? If you mean hide it and restore what was there already, you can't - you need to keep each drawable region in separate buffers and redraw them.
There's not much else to say. Delete a window (make it invisible), never to be redrawn.

Squid already gave you the answer you are looking for then. It is possible to delete the window variable and everything about the window, but what it had drawn to the screen will stay until you draw over it. That is how all computer graphics work (even the computer you are on now). When you want a window to disappear you have to draw over it with what you want to be there. If that is what was there before the window was drawn then you'll have to keep track of what was there before the window was drawn and redraw it when the one you want to "delete" should disappear.
Lyqyd #8
Posted 06 July 2018 - 03:16 AM
This is the problem that compositor was written to solve, if you'd like an example of how to do what SquidDev is talking about.
SquidDev #9
Posted 06 July 2018 - 07:14 AM
There's not much else to say. Delete a window (make it invisible), never to be redrawn.
The issue here is that nobody else knows what you're thinking. Everyone has slightly different interpretations of things, as evidenced by Luca_S's reply. The more information you provide the better (well, within reason) as it helps everyone understand your problem and exactly what you're trying to achieve.