def do_size_allocate(self, allocation): self.set_allocation(allocation) sizes, childrenToAllocate, totalMinWidth = self._update_children_visibility(allocation) extraSpace = allocation.width - totalMinWidth Gtk.distribute_natural_allocation(extraSpace, len(childrenToAllocate), sizes) x = allocation.x for i in range(len(childrenToAllocate)): childAllocation = [] childAllocation.x = x childAllocation.y = allocation.y childAllocation.width = sizes[i].minimum_size childAllocation.height = allocation.height childrenToAllocate[i].size_allocate(childAllocation) x += childAllocation.width