comparison 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
comparison
equal deleted inserted replaced
102:e04f7b552bcd 103:ddd3c8f04640
39 """ 39 """
40 40
41 print "subedit: editing ",sub.name 41 print "subedit: editing ",sub.name
42 self.sub = sub 42 self.sub = sub
43 self.highlighteditsub() 43 self.highlighteditsub()
44 def highlighteditsub(self): 44 def highlighteditsub(self, color='red'):
45 """based on how widgets got self.register'd, we highlight 45 """based on how widgets got self.register'd, we highlight
46 just the row that's being edited""" 46 just the row that's being edited"""
47 47
48 # highlight that row only 48 # highlight that row only
49 for n,wl in self.widgets.items(): 49 for n,wl in self.widgets.items():
50 if n == self.sub.name:
51 self.colorsub(n, color)
52 else:
53 self.colorsub(n, 'restore')
54
55 '''
56 # highlight that row only
57 for n,wl in self.widgets.items():
50 if n==self.sub.name: 58 if n==self.sub.name:
51 for w in wl: 59 for w in wl:
52 w.config(bg='red') 60 w.config(bg=color)
53 else: 61 else:
54 for w in wl: 62 for w in wl:
55 w.config(bg=self.oldcolors[w]) 63 w.config(bg=self.oldcolors[w])
64 '''
65 def colorsub(self, name, color):
66 for w in self.widgets[name]:
67 if color == 'restore':
68 w.config(bg=self.oldcolors[w])
69 else:
70 w.config(bg=color)
56 71
57 # 72 #
58 # next two methods are called by the Stage 73 # next two methods are called by the Stage
59 # 74 #
60 def startlevelchange(self): 75 def startlevelchange(self):