in reply to perl/tk HLIST selections options
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};
|
|---|