【发布时间】:2018-05-10 12:45:04
【问题描述】:
我正在尝试使用 this 在该窗口中添加一个带有诅咒的窗口和一个文本:
window.addstr("This is a text in a window")
代码:
class View:
def __init__(self, ):
self.stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
self.stdscr.keypad(True)
# -----------------
self.add_window_and_str()
self.add_str()
# -----------------
self.stdscr.getkey()
curses.endwin()
def add_str(self): #just text in standart screen
self.stdscr.addstr("test")
self.stdscr.refresh()
def add_window_and_str(self):
scr_limits = self.stdscr.getmaxyx()
win = curses.newwin(scr_limits[0] - 10, scr_limits[1] - 10, 5, 5)
win.addstr("Example String")
win.refresh()
self.stdscr.refresh()
使用self.add_str 添加的文本可见,但“示例字符串”不可见。
如何操作窗口以使该文本可见?
【问题讨论】:
标签: python python-3.x curses python-curses