Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here is my code snippet
I'm able to get the current width and height of my main app viasub CreateUserPopupMenu { my( $self, $event ) = @_; my $x=$event->GetPoint()->x; my $y=$event->GetPoint()->y; print "X: $x\n"; print "Y: $y\n\n"; my $menu=Wx::Menu->new(); $menu->Append($id[1000], "Delete User"); EVT_MENU( $self, $id[1000], \&DeleteUser ); $self->PopupMenu($menu, $x, $y); }
Am I missing the obvious or is there a better way to determine the actual x,y coordinate of my mouse click based on the current screen resolution?my $sz = $self->GetSize(); my ($posx,$posy) = $self->ClientToScreen((0,0)); my $height = $sz->GetHeight(); my $width = $sz->GetWidth();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WxPerl x,y coordinates
by Anonymous Monk on Nov 15, 2008 at 02:03 UTC |