2

I'm trying to catch the click event on a row

For some reason this only works on double click.

@tree.signal_connect("row-activated") do |view, path, column|
    puts "Row #{path.to_str} was clicked!"
end

How can I catch just a single click ?

gpoo
  • 8,408
  • 3
  • 38
  • 53
Paté
  • 1,914
  • 2
  • 22
  • 33

2 Answers2

2

I would say : @tree.signal_connect("cursor-changed") { |w,e| selObj(w,e) }

John Conde
  • 217,595
  • 99
  • 455
  • 496
Nounou
  • 36
  • 2
0

row-activated is the double-click signal. Think of "activated" as "user wants to edit this or do something with it." If you're using VisualRuby, then any GTK object with a show() method should be editable - it'll pop up its window when double-clicked.

I agree with the answer above - a single click changes the cursor, so use cursor-changed.

ChrisPhoenix
  • 1,040
  • 1
  • 11
  • 16