(self)
| 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': |
no test coverage detected