MCPcopy Create free account
hub / github.com/ActiveState/code / resize

Method resize

recipes/Python/578875_Analog_Clock/recipe-578875.py:159–177  ·  view source on GitHub ↗
(self,event)

Source from the content-addressed store, hash-verified

157 ## Called when the window changes, by means of a user input.
158 #
159 def resize(self,event):
160 sc = self.canvas
161 sc.delete(ALL) # erase the whole canvas
162 width = sc.winfo_width()
163 height = sc.winfo_height()
164
165 imgSize = min(width, height)
166 self.pad = imgSize/16
167 viewport = (self.pad,self.pad,width-self.pad,height-self.pad)
168 self.T = mapper(self.world,viewport)
169
170 if self.showImage:
171 flu = self.fluImg.resize((int(0.8*0.8*imgSize), int(0.8*imgSize)), Image.ANTIALIAS)
172 self.flu = ImageTk.PhotoImage(flu)
173 sc.create_image(width/2,height/2,image=self.flu)
174 else:
175 self.canvas.create_rectangle([[0,0],[width,height]], fill = self.bgcolor)
176
177 self.redraw() # redraw the clock
178
179 ## Sets the clock colors.
180 #

Callers 15

toggleImageMethod · 0.95
__init__Method · 0.45
file2matrixFunction · 0.45
watermarkFunction · 0.45
recipe-578386.pyFile · 0.45
recipe-580702.pyFile · 0.45
put_in_front_pictureFunction · 0.45
recipe-523049.pyFile · 0.45
make_contact_sheetFunction · 0.45
txt2imgFunction · 0.45
test1Function · 0.45
test2Function · 0.45

Calls 4

redrawMethod · 0.95
minFunction · 0.85
mapperClass · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected