stepan stepan - 6 months ago 43
Perl Question

WxPerl, getting coordinates from wxPoint object

I want solve this problem.

  1. get position from specific frame (wxFrame) (function GetPosition() return WxPoint)

  2. Serialize position (x, y) to file

  3. set position from file to another window

Everythink is ok, except getting coordinates x and y from WxPoint object.
I don't know, how can I acces properties "x", "y" of this object. e.g wxPython allows this by "
", but WxPerl?
doesn't work, because object is SCALAR reference..

Thank you


The following should do what you're looking for:

my $point = $frame->GetPosition;

my $x = $point->x;
my $y = $point->y;