Easy way to create a set of list/entry widgets?
- From: Tyler Hepworth <raklet gmail com>
- To: gtk-perl-list gnome org
- Subject: Easy way to create a set of list/entry widgets?
- Date: Tue, 4 Jan 2005 22:18:30 -0700
I am trying to create a set of list/entry widgets, but don't desire to
type out the code for each widget, so I tried the following:
my ($name_label, $name_entry,
$area_label, $area_entry,
$soil_label, $soil_entry,
$description_label, $description_entry,
$comments_label, $comments_entry
);
my @values = (["Name: ",$name_label, $name_entry],
["Area: ",$area_label, $area_entry],
["Soil Type: ",$soil_label, $soil_entry],
["Description: ", $description_label, $description_entry],
["Comments: ",$comments_label, $comments_entry]
);
[...] all necessary vboxes, packing, etc go here [...]
foreach my $values (@values) {
\$values->[1] = Gtk2::Label->new ($values->[0]);
\$values->[2] = Gtk2::Entry->new;
}
my $row;
foreach my $values (@values) {
$table->attach_defaults ($values->[1], 0,1, $row, $row + 1);
$table->attach_defaults ($values->[2], 1,2, $row, ++$row);
}
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) or point me in another direction for easily creating
an otherwise cumbersome amount of code for label/entry widgets?
Thanks,
Tyler Hepworth
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]