I have a list of L objects of my class A. This class implements __str__/ __repr__, so each object has its own string representation (not necessarily unique). I have a GUI in pygtk where I have a TreeView widget with a single column. I want to fill it with string representations of objects in L, but then I want to get the selected objects as objects, not as a string. Is there a way to get TreeView to keep a list of objects, but show them as bites? If not, what is the best way to find out which objects are selected in the TreeView? The problem is also that, depending on some conditions, I may not populate the TreeView with all L, but with some sublist, so the indexes of the elements in the TreeView will not correspond to units in L.
source
share