Re: Easy way to create a set of list/entry widgets?

* Tyler Hepworth <raklet gmail com> [2005-01-05 06:21]:
foreach my $values (@values) {
    \$values->[1] = Gtk2::Label->new ($values->[0]);
    \$values->[2] = Gtk2::Entry->new;

[ snip ]

When I run the program, I get the error: "Can't modify single
ref constructor in scalar assignment"

Can someone either shed some light on the error message and how
to fix it (if possible)

Nothing to do with Gtk2.

    $ perl -le' \$_ = "" '
    Can't modify single ref constructor in scalar assignment at -e line 1, at EOF

Lose the backslashes in that foreach loop and it'll work fine.

or point me in another direction for easily creating an
otherwise cumbersome amount of code for label/entry widgets?

Try Glade. Constructing a GUI in Perl is fine for simple
interfaces, and if driven by datastructures is even okay for
slightly less simple interfaces, but it gets messy fast. See

*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}

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