Wie wird das Attribut eines GtkListStore-Speicherobjekts in einer Zeile gespeichert?

Ich versuche, Nicht-Text-Objekte mit dem von mir gefundenen Snippet im ListStore zu behalten. Dies sind die Objekte:

class Series(gobject.GObject, object):
 def __init__(self, title):
  super(Series, self).__init__()
  self.title = title

gobject.type_register(Series)

class SeriesListStore(gtk.ListStore):
 def __init__(self):
  super(SeriesListStore, self).__init__(Series)
  self._col_types = [Series]

 def get_n_columns(self):
  return len(self._col_types)

 def get_column_type(self, index):
  return self._col_types[index]

 def get_value(self, iter, column):
  obj = gtk.ListStore.get_value(self, iter, 0)
  return obj

Und jetzt versuche ich, TreeView so einzustellen, dass es angezeigt wird:

    ...
    liststore = SeriesListStore()
 liststore.clear()

 for title in full_conf['featuring']:
  series = Series(title)
  liststore.append([series])

 def get_series_title(column, cell, model, iter):
  cell.set_property('text', liststore.get_value(iter, column).title)
  return

 selected = builder.get_object("trvMain")
 selected.set_model(liststore)

 col = gtk.TreeViewColumn(_("Series title"))
 cell = gtk.CellRendererText()
 col.set_cell_data_func(cell, get_series_title)
 col.pack_start(cell)
 col.add_attribute(cell, "text", 0)

 selected.append_column(col)
    ...

Aber es schlägt fehl mit Fehlern:

GtkWarning: gtk_tree_view_column_cell_layout_set_cell_data_func: assertioninfo != NULL' failed<br>col.set_cell_data_func(cell, get_series_title) Warning: unable to set propertytext 'vom Typgchararray' from value of type data + TrayIcon + Series '
window.show_all () Warnung: Eigenschaft kann nicht gesetzt werdentext' of typegchararray 'von Wert vom Typ `data + TrayIcon + Series'
gtk.main () gtk.main ()

Was soll ich tun, damit es funktioniert?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage