Hi (sorry for the broken thread, I wasn’t subscribed to the list yet)
PyGTK supports this directly by passing a list of selected rows to the handler
Really? Could you show me a example for that?
You’re script does the trick, though it doesn’t work when
double-clicking, and it
doesn’t restore the selection afterwards. But after rewriting it in
realized that PyGTK has the same behaviour.
The reason I assumed PyGTK handles this is that I saw it in the code of
Python music player Quodlibet, but I just now realized that they use a
TreeView which implements that behaviour (see the MultiDragTreeView in
So, I guess I’ll try to rebuild that class in ruby.
But thanks for your answer, anyway!
Here’s the python version of your script:
window = gtk.Window()
model = gtk.TreeStore(str)
tree_view = gtk.TreeView(model)
prev_selected = 
selected = 
global prev_selected, selected
prev_selected = selected
model, selected = selection.get_selected_rows()
def row_activated(widget, path, column):
cell = gtk.CellRendererText()
column = gtk.TreeViewColumn(“column”, cell)
column.add_attribute(cell, “text”, 0)
for i in range(0, 10):
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
opinions on IT & business topics through brief surveys – and earn cash