def draw(self): ind = 0 self.buffer = "" if any(self.change[self.offset:self.offset + self.dimension.height]): for i, item in enumerate(self.menu): line = item[1] if i >= self.offset and ind < self.dimension.height: #print i, self.offset, ind, self.dimension.height if self.change[i]: if self.cursor == ind: self.buffer = self.buffer + screen.puts( self.dimension.line + ind, self.dimension.coln, line, self.dimension.width, Align.Left, fg=ForegroundColors.White, bg=BackgroundColors.Yellow) else: self.buffer = self.buffer + screen.puts( self.dimension.line + ind, self.dimension.coln, line, self.dimension.width, Align.Left) self.change[i] = 0 ind = ind + 1 return self.buffer
def draw(self): if not self.concealed: return screen.puts(self.dimension.line, self.dimension.coln, self.data, self.length, Align.Left, fg=self.fg, bg=self.bg) else: return ''
def draw(self, force=False): ind = 0 for i, line in enumerate(self.menu): if i >= self.offset and ind < self.dimension.height: if self.change[i]: self.buffer = self.buffer + screen.puts( self.dimension.line + ind, self.dimension.coln, line.strip()) self.change[i] = 0 ind = ind + 1 return self.buffer
def __init__(self, routine, dimension, msg, length=None, align=Align.Left, **kwargs): super(label, self).__init__(routine, dimension, **kwargs) "display a label" self.data = msg self.buffer = screen.puts(self.dimension.line, self.dimension.coln, self.data, length, align, **kwargs)