########################
#
# handleList1
# $Header: /home/cvsroot/tcldb/ucodb/Tlib/handleList1,v 1.1.1.1 1996/10/12 01:08:27 de Exp $
#
#  called during a request for primary selection for listboxes and text
#  that bind the "selection get" command for button-2
#
proc handleList1 {w filtproc offset max} {
  set doproc [string length [info commands $filtproc]]
  if $doproc {
    set s "[$filtproc $w]"
  } else {
    # set s [$w get [lindex [$w curselection] 0] ]
    set i [$w curselection]
    set n ""
    set s ""
    foreach r $i {
      set l [$w get $r]
      append s "${n}$l"
      set n "\n"
    }

  }
  return [string range $s $offset $max]
}


