def rows(grid: Gtk.Grid) -> int: return max(map(lambda child: grid.child_get_property(child, 'top-attach'), grid.get_children()), default=-1) + 1