def add(self, widget): row = ListBoxRow() context = row.get_style_context() widget.context = context widget.set_references() row.child = widget row.add(widget) super(Values, self).add(row)
def f(reference): if state: row = ListBoxRow() row_context = row.get_style_context() set_style(row_context, resource, 'expanded', state) row.add(reference) row.show() self.insert(row, i + j) else: print("removing widget") row = self.get_row_at_index(i) print(reference) print(row.get_children()) row.remove(reference) row.destroy()