When I use window.delch(y, x) in curses, python, the delete will happen on the screen, rather than the virtual screen, that is, the character will be deleted even if I don't call window.refresh(). Why is that, and how would I delete the character only on the virtual screen?
Asked
Active
Viewed 347 times
1 Answers
0
If you could provide some sample code that reproduces your issue, that would be helpful. The behavior of windows, as far as I can reproduce, is that delch()
will not update the screen until refresh()
has been called. See my sample code which demonstrates this:
import curses
import time
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(True)
stdscr.addch(1, 1, ord('a'))
time.sleep(1)
stdscr.refresh()
stdscr.delch(1, 1)
time.sleep(3)
stdscr.refresh()
time.sleep(1)
curses.echo()
curses.nocbreak()
stdscr.keypad(False)
curses.endwin()

brenns10
- 3,109
- 3
- 22
- 24
-
I will add a sample code tomorrow, I fixed the issue but the code is a bit uglier now. – Emlingur Jan 20 '16 at 23:17