MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / view

Method view

tools/python-3.11.9-amd64/Lib/idlelib/tree.py:164–179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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