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