def draw(self): if self.lines > self.h: height = self.lines begin = self.lines - self.h else: begin = 0 height = self.lines for i in range(begin, height): if len(self.line[i]) > self.w: textOut(self.line[i].getRegion(0, self.w), self.x, self.y + i - begin) # textOut("".join([self.line[i][elem] for elem in range(self.w)]), # self.x, self.y + i - begin) else: textOut(self.line[i], self.x, self.y + i - begin)
def drawMenu(menuWin, choice): menuWin.erase() menuWin.box() h, w = menuWin.getmaxyx() textout.textOut(menuTitle, (w - len(menuTitle)) / 2, 0, dst = menuWin) for i in range(len(menuList)): if choice == i: textout.textOut(">", 2, i + 2, dst = menuWin) textout.textOut(menuList[i][0], 4, i + 2, dst = menuWin)
def waveWare(x, y, dst): blue = str(curses.color_pair(curses.COLOR_BLUE)) white = str(curses.color_pair(curses.COLOR_WHITE)) ww = textout.btText("$%" + blue + "$%W$%" + white + "$%ave $%" + blue + "$%W$%" + white + "$%are") textout.textOut(ww, x, y, dst)
def draw(self, x, y): WinObj.draw(self, x, y) textout.textOut(self.title, x, y, dst=self.dst)