+
+ required/$reqkind
+}
+
+
+proc foreach_pixmap_col {var body} {
+ global alloptions
+ upvar 1 $var col
+ for {set col 0} {$col < [llength $alloptions]/3} {incr col} {
+ uplevel 1 $body
+ }
+}
+
+proc pixmap_select {ncol} {
+ global alloptions
+ debug "PIX SELECT $ncol [llength $alloptions]"
+ foreach_pixmap_col col {
+ if {$col==$ncol} continue
+ .d.pe.grid.l$col selection clear 0 end
+ }
+ pixmap_maybe_ok
+}
+proc pixmap_maybe_ok {} {
+ global alloptions pixmap_selcol pixmap_selrow
+ set nsel 0
+ foreach_pixmap_col col {
+ set cs [.d.pe.grid.l$col curselection]
+ incr nsel [llength $cs]
+ set pixmap_selcol $col
+ set pixmap_selrow [lindex $cs 0]
+ }
+ if {$nsel==1} {
+ .d.pe.ok configure -state normal -command pixmap_ok
+ } else {
+ .d.pe.ok configure -state disabled -command {}
+ }
+}
+proc pixmap_ok {} {
+ global database ppm pixmap_selcol pixmap_selrow mainkind alloptions
+ foreach_pixmap_col col {
+ .d.pe.grid.l$col configure -state disabled
+ }
+ .d.pe.ok configure -state disabled
+ helptext {{{ Processing }}}
+ manyset [lrange $alloptions [expr {$pixmap_selcol*3}] end] \
+ colname coldesc rows
+ manyset [lrange $rows [expr {$pixmap_selrow*2}] end] \
+ rowname rowdesc
+ set result "$colname - $rowname"
+ debug "UPDATE PIXMAP AS >$result<"
+ set database($ppm) $result
+ write_database
+ done/$mainkind
+}
+
+proc required/pixmap {} {
+ global unk_what ppm mulcols alloptions
+ must_gets stdin unk_what
+ debug "GOT pixmap $unk_what"
+ set ppm {}
+ while 1 {
+ must_gets stdin ppml
+ if {![string length $ppml]} break
+ append ppm $ppml "\n"
+ }
+ set data [exec pnmscale 2 << $ppm]
+ image create photo image/main -data $data
+
+ set alloptions [exec ./yppsc-resolver-pixoptions $unk_what]
+
+ read_database ./pixmaps.txt
+
+ set mulcols [image width image/main]
+ set mulrows [image height image/main]
+ resize_widgets_core
+ place forget .d.mi.csr_0
+ place forget .d.mi.csr_1
+
+ pack forget .d.csr .d.got
+ pack .d.pe -side top -before .d.mi -pady 10
+
+ eval destroy [winfo children .d.pe.grid]
+ set col 0; foreach {colname coldesc rows} $alloptions {
+ debug "INIT $col $colname \"$coldesc\""
+ label .d.pe.grid.t$col -text $colname
+ listbox .d.pe.grid.l$col
+ foreach {rowname rowdesc} $rows {
+ debug "INIT $col $colname \"$coldesc\" $rowname \"$rowdesc\""
+ .d.pe.grid.l$col insert end $rowdesc
+ }
+ bind .d.pe.grid.l$col <<ListboxSelect>> [list pixmap_select $col]
+ grid .d.pe.grid.t$col -column $col -row 0
+ grid .d.pe.grid.l$col -column $col -row 1
+ incr col
+ }
+ pixmap_maybe_ok
+
+ helptext {
+ {{Indicate the correct parse of this image, and click OK.}}
+ }
+}
+
+proc required/char {} {
+ global mulrows glyphsdone unk_l unk_r unk_contexts rows
+
+ must_gets stdin l
+