Brian Millham wrote:
I have a question on the proper use of regions.  According to the
documentation, CreateRectRgn(LEFT, TOP, WIDTH, HEIGHT) is the proper use.
However, I've discovered that there is another argument expected,
CreateRectRgn(x, LEFT, TOP, WIDTH, HEIGHT).  I'm not sure that the first
argument is supposed to be, but I also discovered that it doesn't seem to
matter.

Does anyone know what the argument should be?

It's the class name. It's intended to be called as a class method, rather than as a static function:

  my $region = Win32::GUI::Region->CreateRectRgn($l, $t, $w, $h);

or

  my $region = CreateRectRgn Win32::GUI::Region($l, $t, $w, $h);

[I believe that most style guides recommend the first of these 2]

(compare to how you call a constructor for a window:
  my $win = Win32::GUI::Window->new( ... );
  my $win = new Win32::GUI::Window ( ... );

not
  my $win = Win32::GUI::Window::new( ... );
)

Regards,
Rob.

Reply via email to