single-click treeview
- From: Jaap Karssenberg <j g karssenberg student utwente nl>
- To: GTK2-Perl List <gtk-perl-list gnome org>
- Subject: single-click treeview
- Date: Tue, 18 Oct 2005 10:05:10 +0200
Greetings,
I'm trying to get a treeview to activate a row on single-click instead
of double-click. (Btw. I'm not really sure whether this default depends
on any gtk settings.)
So for I just attached a signal to the button_release_event which
activates the row. This kind of works but now I also activate the row
when I click on the little arrow (expander) in front of a list item with
sub items. This is wrong because now I can't open sublists by clicking
the arrow correctly (they do open if I click on the text part of the
row). Is there a way to tell if the pointer is over this area of the row
so I handle this case differently ?
Code listing of the button_release_event handler:
$tree_view->signal_connect(button_release_event => sub {
my ($x, $y) = $_[1]->coords;
my ($path, $column, $c_x, $c_y) =
$tree_view->get_path_at_pos($x, $y);
print "got row: $path, $column, $c_x, $c_y\n";
$tree_view->row_activated($path, $column);
return 0;
} );
Thanks!
-- Jaap
P.S. Yesterday I wrote a Gtk2::Ex::ButtonPathBar which represents a path
with a list of buttons, like the path in the gtk filechooser. I
translated part of the C code I found in the Thunar filer project to
pure perl. Got all the size_allocate stuff working :) Probably it will
find it's way to CPAN in the near future.
--
) ( 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]