RE: [gtkmm] Keyboard/Mouse signals on a TreeView?



> From: Markus Gerwinski [mailto:markus gerwinski de] 
> I'm trying to add signal handlers to a TreeView to trigger 
> editing of a line by
> double-click or ENTER. However, the TreeView seems to ignore 
> my signals.
> Currently, my code looks like this:
> 
>   DefaultCustomerListView::DefaultCustomerListView () {
>     // ... [some constructor stuff]
>     dataTree.signal_key_press_event () .connect (
>       SigC::slot ( *this, &DefaultCustomerListView::_key_pressed ) );
>     dataTree.signal_button_press_event () .connect (
>       SigC::slot ( *this, 
> &DefaultCustomerListView::_button_pressed ) );
>   } // DefaultCustomerListView::DefaultCustomerListView
> 
>   bool DefaultCustomerListView::_key_pressed ( GdkEventKey *event ) {
[snip]

There is already be a row activated signal so you shouldn't need to do this
in detail:
http://www.gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1TreeView.html#a9
4

I guess I should add it to the book.

I know there are lots of other useless and distracting signals in that
reference too, but they are at least removed in gtkmm 2.4.

Murray Cumming
murrayc usa net
www.murrayc.com 



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