from ACursesEX import *
import curses
mainwin = curses.newwin(15,50,0,0)
mainwin.box()
mainwin.addstr(0,0,"主窗口")
mainwin.refresh()
cwin = curses.newwin(5,20,2,2)
cwin.addstr(1,1,"子窗口")
cwin.box()
cwin.refresh()
while(True):
ch = cwin.getch()
cwin.clear()
cwin.addch(2,1,ch)
cwin.touchwin()
cwin.refresh()
try:
initapp()
try:
main()
except:
traceback.print_exc()
finally:
endapp()
clear( ) :
Like erase(), but also causes the whole window to be repainted upon next call to refresh().
看来还是自己太粗心了!