Hi! Thank you very much for your help. On Tue, 24 Apr 2001, Jake Wasserman wrote: > Instead of using stdscr.subwin() you need to make a new window using > curses.newwin() and the same arguments get what you want. You also need I tried this before mailing the question - but failed. For example, the following program works (draws 2 windows) with stdscr.subwin, but does not draw them with curses.newwin. Did I miss something? import curses def make_win(stdscr, h,l, y,x, str): win = stdscr.subwin(h,l, y,x) # ??? win.erase() win.box() win.addstr(2, 2, str) return win def test(stdscr): curses.curs_set(0) stdscr.box() stdscr.addstr(2, 2, "windows everywhere") win1 = make_win(stdscr, 10,12, 5,5, "Window 1") win2 = make_win(stdscr, 10,12, 8,8, "Window 2") stdscr.refresh(); c = stdscr.getch() if __name__ == '__main__': curses.wrapper(test) > an extra curses.panel.update_panels() inside the for loop that moves > panel2. Yes, and much more important I need to call it BEFORE top()! This program works finally; and - surprise - it works with curses.newwin! I do not understand why it works and previous program does not. from time import sleep import curses, curses.panel def make_panel(h,l, y,x, str): win = curses.newwin(h,l, y,x) win.erase() win.box() win.addstr(2, 2, str) panel = curses.panel.new_panel(win) return win, panel def test(stdscr): curses.curs_set(0) stdscr.box() stdscr.addstr(2, 2, "panels everywhere") win1, panel1 = make_panel(10,12, 5,5, "Panel 1") win2, panel2 = make_panel(10,12, 8,8, "Panel 2") curses.panel.update_panels(); stdscr.refresh() sleep(1) panel1.top(); curses.panel.update_panels(); stdscr.refresh() sleep(1) for i in range(20): panel2.move(8, 8+i) curses.panel.update_panels(); stdscr.refresh() sleep(0.1) sleep(1) if __name__ == '__main__': curses.wrapper(test) Oleg. ---- Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4