Mercurial > code > home > repos > light9
diff light8/subediting.py @ 103:ddd3c8f04640
more untested code, ready for production: colors for slider mapping
author | dmcc |
---|---|
date | Sun, 14 Jul 2002 09:07:14 +0000 |
parents | 032b2b67bc10 |
children |
line wrap: on
line diff
--- a/light8/subediting.py Sun Jul 14 08:01:24 2002 +0000 +++ b/light8/subediting.py Sun Jul 14 09:07:14 2002 +0000 @@ -41,18 +41,33 @@ print "subedit: editing ",sub.name self.sub = sub self.highlighteditsub() - def highlighteditsub(self): + def highlighteditsub(self, color='red'): """based on how widgets got self.register'd, we highlight just the row that's being edited""" # highlight that row only for n,wl in self.widgets.items(): + if n == self.sub.name: + self.colorsub(n, color) + else: + self.colorsub(n, 'restore') + + ''' + # highlight that row only + for n,wl in self.widgets.items(): if n==self.sub.name: for w in wl: - w.config(bg='red') + w.config(bg=color) else: for w in wl: w.config(bg=self.oldcolors[w]) + ''' + def colorsub(self, name, color): + for w in self.widgets[name]: + if color == 'restore': + w.config(bg=self.oldcolors[w]) + else: + w.config(bg=color) # # next two methods are called by the Stage