Re: single-click treeview



Jaap Karssenberg wrote:
I'm trying to get a treeview to activate a row on single-click instead of double-click.

Answering my own question for completeness of the mail archive:

Instead of connecting to the button_release_event connect to
the TreeSelection "changed" signal

        $treeview->get_selection->signal_connect(changed => sub {
                my ($path) = shift->get_selected_rows;
                my $col = $tree_view->get_column(0);
                $tree_view->row_activated($path, $col);
        }

Only mind you that you block this signal handler when selecting from other parts of your code.

Cheers!

--
   )   (     Jaap Karssenberg || Pardus [Larus]                | |0| |
   :   :     http://pardus-larus.student.utwente.nl/~pardus    | | |0|
 )  \ /  (                                                     |0|0|0|
 ",.*'*.,"   Proud owner of "Perl6 Essentials" 1st edition :)  wannabe



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