[gtkmm] Receiving mouse button click info in Gtk::Treeview


I would like to be able to receive mouse button click events in a Gtk::Treeview. 
When the user clicks in the TreeView I need to be able to determine which column 
and row the click occured in as well as which mouse button was pressed.

I tried connecting to  Gtk::TreeView.signal_button_press_event() but the 
callback is never called, I also tried adding events with 
Gtk::TreeView.add_events(Gdk::BUTTON_PRESS_MASK) which still does not cause the 
callback to be called.

If I can get the callback to work I can determine the row by looking at the 
Gtk::TreeSelection but I do not know how to determine the column in which the 
click occured.

Another option would be to subscribe to the Gtk::TreeSelection::on_changed() 
event which would probably give me the row but not the column or the type of 
mouse button click (Left, right etc)

Thanks !
Liza Klerck

Gtk::TreeView m_TreeView;	
m_TreeView.signal_button_press_event().connect(  SigC::slot(*this, 
&ExampleWindow::on_m_TreeView_button_press) );

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]