def bind(self, list_box): if isinstance(list_box, Gtk.ListBox): self._list_box = list_box list_box.connect('add', lambda _, __: self.update()) list_box.connect('remove', lambda _, __: self.update())