MCPcopy Index your code
hub / github.com/python/cpython / view

Method view

Lib/idlelib/tree.py:166–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

164 self.update()
165
166 def view(self):
167 top = self.y - 2
168 bottom = self.lastvisiblechild().y + 17
169 height = bottom - top
170 visible_top = self.canvas.canvasy(0)
171 visible_height = self.canvas.winfo_height()
172 visible_bottom = self.canvas.canvasy(visible_height)
173 if visible_top <= top and bottom <= visible_bottom:
174 return
175 x0, y0, x1, y1 = self.canvas._getints(self.canvas['scrollregion'])
176 if top >= visible_top and height <= visible_height:
177 fraction = top + height - visible_height
178 else:
179 fraction = top
180 fraction = float(fraction) / y1
181 self.canvas.yview_moveto(fraction)
182
183 def lastvisiblechild(self):
184 if self.children and self.state == 'expanded':

Callers 1

expandMethod · 0.95

Calls 5

lastvisiblechildMethod · 0.95
canvasyMethod · 0.80
winfo_heightMethod · 0.80
_getintsMethod · 0.80
yview_movetoMethod · 0.80

Tested by

no test coverage detected