Use Gtk.TreePaths instead of ints
Thomas Ross
3 years ago
2453 | 2453 | Gtk.main_iteration() |
2454 | 2454 | # Keep item in visible rect: |
2455 | 2455 | visible_rect = treeview.get_visible_rect() |
2456 | row_rect = treeview.get_background_area(rownum, self.tvcolumn1) | |
2456 | row_rect = treeview.get_background_area( | |
2457 | Gtk.TreePath(rownum), self.tvcolumn1 | |
2458 | ) | |
2457 | 2459 | if row_rect.y + row_rect.height > visible_rect.height: |
2458 | 2460 | top_coord = ( |
2459 | 2461 | row_rect.y + row_rect.height - visible_rect.height |
2506 | 2508 | # Keep item in visible rect: |
2507 | 2509 | rownum = rownum + 1 |
2508 | 2510 | visible_rect = treeview.get_visible_rect() |
2509 | row_rect = treeview.get_background_area(rownum, self.tvcolumn1) | |
2511 | row_rect = treeview.get_background_area( | |
2512 | Gtk.TreePath(rownum), self.tvcolumn1 | |
2513 | ) | |
2510 | 2514 | if row_rect.y + row_rect.height > visible_rect.height: |
2511 | 2515 | top_coord = ( |
2512 | 2516 | row_rect.y + row_rect.height - visible_rect.height |
2546 | 2550 | # Keep item in visible rect: |
2547 | 2551 | rownum = rownum - 1 |
2548 | 2552 | visible_rect = treeview.get_visible_rect() |
2549 | row_rect = treeview.get_background_area(rownum, self.tvcolumn1) | |
2553 | row_rect = treeview.get_background_area( | |
2554 | Gtk.TreePath(rownum), self.tvcolumn1 | |
2555 | ) | |
2550 | 2556 | if row_rect.y + row_rect.height > visible_rect.height: |
2551 | 2557 | top_coord = ( |
2552 | 2558 | row_rect.y + row_rect.height - visible_rect.height |