# $Header: /home/cvsroot/tcldb/wisql/Tlib/setPrint,v 1.4 1997/08/28 05:24:22 de Exp $
# tcl procs saved on Tue Sep 05 09:33:13 PDT 1995

proc setPrint {w col} {



	upvar #0 EZRcols cols
	upvar #0 EZRcolatts colatts
	upvar #0 EZRprints prints
	upvar #0 EZRporder porder
	upvar #0 EZRnumprt numprt


	puts stderr "setPrint $w $col"
#	All new columns are added to the end of the print list


#	If this field was selected for print then unselect it
#	else if it was not selected then select it.  Ready?

	set pn $numprt
#	this is the index of the next meaningful new/recycled element


	# funky! tk4.0 causes -variable for .pb to be set before this proc!
	if {$prints($col)} {
		deleteElem $col EZRporder $numprt
		$w.data.pic.win.winL.$col.pb deselect
		$w.data.pic.win.winL.$col.pb configure -relief flat
		$w.data.pic.win.winL.$col.po delete 0 end
		set prints($col) 0
		incr numprt -1
	} else {
		set porder($pn) $col
		$w.data.pic.win.winL.$col.pb select
		set prints($col) 1
		$w.data.pic.win.winL.$col.po insert 0 $pn
		incr numprt
	}

        loop p 0 $numprt {
                set c $porder($p)
                $w.data.pic.win.winL.$c.po delete 0 end
                $w.data.pic.win.winL.$c.po insert 0 $p
        }

}

