ftp.nice.ch/pub/next/graphics/vector/PencilTWO.s.tar.gz#/PencilTWO/Source/PencilLibrary/DocToPalette.tcl

This is DocToPalette.tcl in view mode; [Download] [Up]

# add all graphic objects in current document to the palette
# look for file <documentname>.names that gives the object's names

catch {unset onames}
set docpath [file root [P_name]]
if [file exists $docpath.names] {
	set f [open $docpath.names]
	set i 0
	foreach n [read $f] {
		set onames($i) $n
		incr i
	}
	close $f
}

set doc [file tail $docpath]

set c [P_objectcount]
for {set i 0} {$i<$c} {incr i} {
P_select1 $i
if [info exists onames($i)] {P_addToPalette $onames($i)} {P_addToPalette $doc$i}
}
catch {unset onames}
PDrefresh
 

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.