Mercurial > code > home > repos > light9
comparison light8/stage.py @ 8:6faae180d1c5
conv image to gif, clean up source formatting
author | drewp |
---|---|
date | Sun, 07 Jul 2002 05:05:36 +0000 |
parents | 1b0266dd233a |
children | 533ac835083f |
comparison
equal
deleted
inserted
replaced
7:1b0266dd233a | 8:6faae180d1c5 |
---|---|
151 print "change by",delta | 151 print "change by",delta |
152 | 152 |
153 if self.lmbstate=='rectangle': | 153 if self.lmbstate=='rectangle': |
154 sr = self.find_withtag('selectrect') | 154 sr = self.find_withtag('selectrect') |
155 if not sr: | 155 if not sr: |
156 sr=self.create_rectangle( self.lmbstart[0],self.lmbstart[1],coords[0],coords[1],tag='selectrect') | 156 sr=self.create_rectangle( self.lmbstart[0],self.lmbstart[1],coords[0],coords[1], |
157 # sr=self.create_rectangle( *(self.lmbstart+coords), tag='selectrect' ) | 157 outlinestipple='gray50', |
158 | 158 tag='selectrect') |
159 | |
160 # move rectangle with mouse | |
159 self.coords(sr,*(self.lmbstart+coords)) | 161 self.coords(sr,*(self.lmbstart+coords)) |
160 | 162 |
161 # redo the dynselection with the new rectangle | 163 # redo the dynselection with the new rectangle |
162 self.replacedynselection([o for o in self.findoverlappinglights((self.lmbstart+coords),1)]) | 164 self.replacedynselection([o for o in self.findoverlappinglights((self.lmbstart+coords),1)]) |
163 | 165 |
234 return lights | 236 return lights |
235 | 237 |
236 root=Tk() | 238 root=Tk() |
237 root.wm_geometry("+376+330") | 239 root.wm_geometry("+376+330") |
238 s=Stage(root) | 240 s=Stage(root) |
239 s.setimage('guysanddolls.ppm') | 241 s.setimage('guysanddolls.gif') |
240 s.pack() | 242 s.pack() |
241 s.addlight('drew',(330,640),(90,20)) | 243 s.addlight('drew',(330,640),(90,20)) |
242 s.addlight('house',(360,640)) | 244 s.addlight('house',(360,640)) |
243 s.addlight('barn',(390,640)) | 245 s.addlight('barn',(390,640)) |
244 | 246 |