The syntax of Gnome2::Canvas::Line?



Hi list,

This is an example from the tarball of how to draw a line:

Gnome2::Canvas::Item->new ($group,
                           'Gnome2::Canvas::Line',
                           points => [200.0, 0.0, 200.0, 450.0],
                           fill_color => 'black',
                           width_units => 4.0);

My puzzle is why the syntax is any different from Rectangle, i.e.
why use 'points' instead of x1,y1,x2,y2?

Second, the use of brackets instead of () to describe points is
a complete surprise to me.  I'm new to perl and I've never seen
that syntax used in any of the perldocs I've read (so far).
What's the difference in this context between [] and ()?

Thanks.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]