in reply to Gtk2::TreeView get_path_at_pos doesn't return array on Windows

I've found a workaround. I simply query the column widths for each column (these may have changed, because the user could resize them), make an array that holds the cumulative column boundary positions, then check if the click was between the borders of the special column.

The relevant part to be replaced in the code above follows.
$tslist->signal_connect('button-release-event' => sub { my ($self, $event) = @_; my ($path, $column, $cell_x, $cell_y) = $tslist->get_path_a +t_pos ($event->x, $event->y ); # <------- !!!!! my @widths; $widths[0] = $columns[0]->get_width(); for my $i (1..$#columns) { $widths[$i] = $widths[$i-1] + $columns[$i]->get_width( +); } if ($path) { if ($event->x > 0 and $event->x < $widths[0]) { my $row = $path->to_string; my $value = $dtslist->[$row][0]; $dtslist->[$row][0] = $activity_list{$activity_order{$ +activities_rev{$value}}}; } } });
  • Comment on Re: Gtk2::TreeView get_path_at_pos doesn't return array on Windows
  • Download Code