develooper Front page | perl.wxperl.users | Postings from December 2012

event coordinates

Thread Next
Alexandr Ciornii
December 9, 2012 16:04
event coordinates
Message ID:

I'm writing a program that uses Wx::TreeListCtrl. I want to show
context menu on right click. But event 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 $menu = Wx::Menu->new();
	$menu->Append( 71000, "New Reserved Section...", "" );
	#if ($event->GetEventType == Wx::wxMouseEvent) {
	my $point = $event->GetPoint;
	print $point->x, $point->y,"\n";
        $self->PopupMenu( $menu, $point->x, $point->y );

Also, how can I use constants for GetEventType method?
Wx::wxMouseEvent does not exist.

Alexandr Ciornii,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About