Re: Extracting data from SimpleList

muppet wrote:

        print "row $i is ".join (", ", @{ $slist->{data}[$i] })."\n";

Note that even though you have only one column of data $slist->{data}[$i] is still a reference to an array of columns.

Very useful, this is exactly what I needed, since I'm actually using
multiple columns. For the record, I'm using:

sub shout_it {
   @indices = $slist -> get_selected_indices;

   foreach $i (@indices) {
       foreach (@{$slist->{data}[$i]}) {
           print $_ . "\t";
       print "\n";

Dan's method:

   $selection = $slist->get_selection;
   ($liststore,$iter) = $selection->get_selected;
   foreach ($liststore->get($iter)) {
       print $_ . "\t";

works as well. Thanks for your help everyone!


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