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

Re: Extracting data from SimpleList



Scott <wwsw3 earthlink net> writes:
> Hi All,
> 
> Using the wonderful SimpleList to bypass dealing with the TreeView stuff 
> is pretty handy. However, how does one get the data back out of the 
> list? I've attached a small example where I am printing out the indices 
> very easily, but I see no docs on accessing the data, except for 
> get_row_data_from_path. How do I get the path? From my admittedly 
> ignorant point of view, it would be super if there was a 
> get_row_data_from_index. Anyone else think that would be useful?
...
> $button -> signal_connect(clicked => \&shout_it, $window);
...
> sub shout_it {
> 	@indices = $slist -> get_selected_indices;
> 	
> 	foreach $i (@indices) {
> 		print $i . "\n"; # I'd rather print the actual data here.
> 	}		
> }

Watch out for my answers, I'm just visiting this list
while I work out some issues.  I think this will work,
it seems to be working for me:

  my $selection = $slist->get_selection;
  my ($liststore,$iter) = $selection->get_selected;
  my @a = $liststore->get($iter,0..4); # Get first 5 data fields

-- 
Dan Espen                           E-mail: dane mk telcordia com



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