Re: The syntax of Gnome2::Canvas::Line?

Applications From Scratch:

--- On Sat, 6/14/08, walt <wa1ter myrealbox com> wrote:

From: walt <wa1ter myrealbox com>
Subject: The syntax of Gnome2::Canvas::Line?
To: gtk-perl-list gnome org
Date: Saturday, June 14, 2008, 7:57 AM
Hi list,

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

Gnome2::Canvas::Item->new ($group,
                         points => [200.0, 0.0, 200.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
What's the difference in this context between [] and


gtk-perl-list mailing list
gtk-perl-list gnome org

(...) means list; [...] means anonymous array reference.

You'll have to read a tutorial on Perl references, but before you need
to understand Perl in its referenceless part.

Probably dealing with GUI stuff is too complex for a newbie.



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