Subject: | no coordinates for event |
I want to show context menu on right click. But event always has
coordinates (0,0), so context menu is shown in the incorrect place.
Here is my code:
sub on_right_down {
my $self = shift;
my $event = shift; #Wx::TreeEvent
my $point = $event->GetPoint;
print $point->x, $point->y, "\n"; #Always prints 00 here
my $menu = Wx::Menu->new();
$menu->Append( 71000, "New Reserved Section...", "" );
$self->PopupMenu( $menu, $point->x, $point->y );
}
Similar code with Wx::TreeCtrl instead of Wx::TreeListCtrl works correctly.
--
Alexandr Ciornii, http://chorny.net