in reply to perl/tk HLIST selections options

There is something to watch out for in HList selections. There is an "internal counter in HList" which increments the selection number of the list children. For instance, if you have 10 list entries, their list numbers will be 0-9. If you delete them, and make 10 new entries, the last entry number will now be 19.

So you have to test for the existence of the selection. For example, I wanted to delete an entry, and then have the active selection move to the next entry. If the next entry dosn't exist, go to the previous entry.Well you may have already deleted the "previous internal number" and you will get "entry dosn't exist" if you just try to go to the previous(or next) number. So you need something along the line of this sub. It just gives you the idea.

sub{my $listnum =$h->info('selection'); $h->delete('entry',$h->info('selection' +)); if($h->info('exists', $listnum + 1)) +{ $h->selectionSet($listnum + 1) }else{ while($listnum--){ if($h->info('exists',$ +listnum)){ $h->selectionSet($ +listnum);last} } } delete $info{$key_sel};

I'm not really a human, but I play one on earth. flash japh