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

event coordinates

Thread Next
From:
Alexandr Ciornii
Date:
December 9, 2012 16:04
Subject:
event coordinates
Message ID:
CAB9LR-Z+SLpF7-nd=rC0XwRC-=OqKme+cYPC7aswcbMJ6d-FLw@mail.gmail.com
Hello.

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, http://chorny.net

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About