Re: logical barred ?



        Hello,

Oliver Grawert wrote:
could someone give me a hint why the following code doesn't work:

----snip----
push(@tmp, (shift(@tmp)." => 'text'")) foreach(@tmp);
my $listview = Gtk2::SimpleList->new(@tmp);
----snap----

@tmp is populated with the column names from a database query. maybe i'm
on the totally wrong path. how am i supposed to use Gtk2::SimpleList
with headers changing dynamically on each request ?

the help of a more enlightened person would be fine....

        First, what you do with @tmp is not very clear. I think you meant:

push @tmp2, "$_ => 'text'" foreach @tmp;

Second, you want to pass a list of strings to Gtk2::SimpleList->new(), that does not work. Instead, pass it twice more arguments, like this:

----snip----
push @tmp2, ($_, 'text') foreach @tmp;
my $listview = Gtk2::SimpleList->new(@tmp2);
----snap----

        and that should work.

        HTH,

Alex.



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