subr t3d_select_delete_cb
 ;deletes the current selection from the "selected" images list
 ;if in the list of lists, that list is also adjusted
 iq = $t3dselected_item_position - 1
 ind = sieve($t3d_selected_tops ge iq)
 if isscalar(ind) then { errormess, 'internal error in\nselected list widget'
 	return }
 xmlistdeleteitem, $t3selectedwidget, $t3dselected_item_position
 ;all $t3d_selected_tops with ind are affected
 $t3d_selected_tops(ind) = $t3d_selected_tops(ind) - 1
 n = dimen($t3d_selected_image_nums,0) - 1
 if iq lt n then {
 for i=iq,n-1 do {
   $t3d_selected_image_nums(i) = $t3d_selected_image_nums(i+1)
   $t3d_selected_xc(i) = $t3d_selected_xc(i+1)
   $t3d_selected_yc(i) = $t3d_selected_yc(i+1)
   $t3d_selected_times(i) = $t3d_selected_times(i+1)
   $t3d_selected_pixsc(i) = $t3d_selected_pixsc(i+1)
 }}
 save = !REDIM_WARN_FLAG
 !REDIM_WARN_FLAG = 0
 redim, $t3d_selected_image_nums, n
 redim, $t3d_selected_xc, n
 redim, $t3d_selected_yc, n
 redim, $t3d_selected_times, n
 redim, $t3d_selected_pixsc, n
 !REDIM_WARN_FLAG = save
 xmsetlabel, $t3select_lab1, -
 	sprintf('%d files, %d images',dimen($t3d_selected_image_files,0), n)
 ;was it included in the list of lists?
 ty,'checking for back modifiy, $t3dselected_list_of_lists =', $t3dselected_list_of_lists
 if $t3dselected_list_of_lists ne -1 then {
  ;change the copy in lists of lists
  imagelist_set_arrays_t3d, $t3dselected_list_of_lists	;sets the arrays
  imagelist_reload_list		;need to re-write list of lists
 }
 endsubr
 ;===============================================================================
