1

I have a treeview and I am watching for the cursor-changed and row-activated signals. The problem is that in order to trigger the row-activate I first have to click on the row (triggering cursor-changed) and then do the double click, requiring 3 clicks.

Is there a way to respond to both signals with 2 clicks?

gpoo
  • 8,408
  • 3
  • 38
  • 53
Rob
  • 2,511
  • 2
  • 20
  • 31

2 Answers2

4

It's not very clear what you're trying to achieve. I guess you're trying to respond to the user changing the selection in the treeview.

If this is the case, connect to the [changed][1] signal on the gtk.TreeSelection:

selection = treeview.get_selection()
selection.connect('changed', self.on_treeview_selection_changed)

As far as I can tell, this is not possible using the glade interface designer.

If, however, you are trying to do something else entirely, please add some more information.

Jon
  • 9,815
  • 9
  • 46
  • 67
3

The cursor-changed signal is emitted even when single clicking on the same (selected) row. Still, the row-activated signal is emitted when you double click on a row, whether it was selected before the double click or not. Thus you don't need 3 clicks to trigger a row-activated.

As Jon mentioned, you want to connect to the selection's changed signal in stead of cursor-changed.

Walter
  • 7,809
  • 1
  • 30
  • 30