def update(self): self.update_lock.acquire() if self.error is None: attr = style.attr('statusbar') else: attr = style.attr('statusbar_error') line = 'Command: [%10s]' % self.cmd[:10] line += ' Stack:' for s in xrange(4): if s == self.stack: line += " <%d>" % (s + 1) else: line += " %d " % (s + 1) if self.error is not None: err = ' Error: %s' % self.error else: err = '' line += err.rjust(self.width - len(line) - 1) self.win.addnstr(0, 0, line, self.width - 1, attr) self.update_lock.release()
def update(self): if self.selected: attr = style.attr("bar_selected") else: attr = style.attr("bar_deselected") self.win.attron(attr) self.win.box() self.win.attroff(attr) for n in xrange(3): if self.inverted or self.view_inverted: sectnum = 2 - n else: sectnum = n if self.sections[sectnum].dimmer is not None: attr = style.attr("section_activated") elif self.sections[sectnum].selected: attr = style.attr("section_selected") else: attr = style.attr("section_deselected") self.win.attron(attr) self.win.addstr(0, 2 + n * (self.root.BAR_LENGTH / 3), " %d.%d " % (self.number, sectnum + 1)) self.win.addch(curses.ACS_DARROW) self.win.addch(" ") self.win.attroff(attr)
def draw_box(self): if self.is_active: attr = style.attr('fader_active') else: attr = style.attr('fader_inactive') self.outer.attron(attr) self.outer.box() self.outer.attroff(attr)
def update(self): self.dimmer_lock.acquire() if self.sect is not None: if self.dimmer is None: dim = 0 else: dim = int(max(self.color.to_tuple()) / 255.0 * self.dimmer / 255.0 * len(self.dimchars)) try: dimchar = self.dimchars[dim] except IndexError: dimchar = self.dimchars[len(self.dimchars) - 1] colname = self.color.get_name() if colname is not None: attr = style.attr("color_%s" % colname) else: attr = 0 self.sect.hline(0, 0, dimchar, self.length, attr) elif self.rect is not None: if self.dimmer is None: dim = 0 else: dim = self.dimmer color = self.color.to_tuple(use_alpha=dim) self.rect.fill(*color) self.dimmer_lock.release()
def update(self): if not self.is_active.isSet(): return ts = time.strftime('%H:%M:%S') for n in xrange(3): for i, char in enumerate(ts): try: line = NUMBERS[char][n] except IndexError: continue if char == ':': attr = style.attr('clock_dots') else: attr = style.attr('clock_number') self.win.addstr(n, i * 4, line, attr) self.refresh()
def update(self): clist = iter(self.chasers) for n in range(self.listlen * self.COLUMNS): try: chaser = clist.next() except StopIteration: chaser = None if chaser is not None: label = "%2d. %s" % (n, chaser.label) else: label = "%2d." % n label += " " * (self.listwidth - len(label)) if self.pointer == n: if chaser is not None and chaser.is_cue: attr = style.attr('list_cue_highlight') elif chaser is not None and chaser in self.active_chasers: attr = style.attr('list_active_highlight') else: attr = style.attr('list_highlight') else: if chaser is not None and chaser.is_cue: attr = style.attr('list_cue') elif chaser is not None and chaser in self.active_chasers: attr = style.attr('list_active_normal') else: attr = style.attr('list_normal') self.menu.attron(attr) self.menu.addstr(n % self.listlen, self.listwidth * (n // self.listlen), label[:self.listwidth-1]) self.menu.attroff(attr) return for n, c in enumerate(self.chasers): item = c[:self.listwidth] self.menu.addstr(n, 0, item) self.listlen