exit 16
}
+proc execpnm_createphoto {photoname args} {
+ set tmpfile ./_dictimage.tmp
+ eval exec $args > $tmpfile
+ image create photo $photoname -file $tmpfile
+ file delete $tmpfile
+}
+
#---------- display core ----------
set mul 6
button .pe.ok -text OK
pack .pe.grid .pe.ok -side left
+ bind .pe.ok <Key-Return> { .pe.ok invoke }
pack .d.mi .d.ctx -side top -anchor w
pack .d -fill x -padx 2 -pady 2
proc select_database {dbname_spec} {
global dbname
set dbname $dbname_spec
- read_database "./#local-$dbname#.txt"
+ read_database "./_local-$dbname.txt"
}
proc do_database_update {im def} {
if {$col==$ncol} continue
.pe.grid.l$col selection clear 0 end
}
- pixmap_maybe_ok
+ if {[pixmap_maybe_ok]} {
+ focus .pe.ok
+ }
}
proc pixmap_maybe_ok {} {
global alloptions pixmap_selcol pixmap_selrow
if {$nsel==1} {
debug "MAYBE_OK YES col=$pixmap_selcol row=$pixmap_selrow."
.pe.ok configure -state normal -command pixmap_ok
+ return 1
} else {
.pe.ok configure -state disabled -command {}
+ return 0
}
}
proc pixmap_ok {} {
if {![string length $ppml]} break
append ppm $ppml "\n"
}
- set data [exec pnmscale 2 << $ppm]
- image create photo image/main -data $data
+ execpnm_createphoto image/main pnmscale 2 << $ppm
set alloptions [exec ./database-info-fetch $unk_what]
pixmap_maybe_ok
helptext {
- {{Indicate the meaning of this image, and click OK.}}
+ {{Indicate the meaning of this image; then click OK or hit Return.}}
}
}
append o $ointerl
}
- debug "DATA1 $o"
- set tmpfile ./#dictimage#.tmp
- exec pnmscale 1 << $o >$tmpfile
- image create photo image/main -file $tmpfile
- file delete $tmpfile
+# debug "DATA1 $o"
+
+ execpnm_createphoto image/main pnmscale 1 << $o
}
#---------- character set editor display ----------
manyset [dict2_reqkind_rows $dict] reqkind rows
if {$yesno} {
- read_database $dictdir/master-$dict.txt
+ set fnbase $dictdir/master-$dict.txt
+ read_database $fnbase
set database($key) $val
write_database
+
+ exec gzip --rsyncable -7 < $fnbase > $fnbase.gz.new
+ exec mv -f -- $fnbase.gz.new $fnbase.gz
+
set desc approve
} else {
set desc reject
set image [exec pgmtoppm {#008-white} << $image | pnmnoraw]
append image "\n"
}
- set image [exec pnmscale 2 << $image]
-
- image create photo approve/$ix -data $image
+ execpnm_createphoto approve/$ix pnmscale 3 << $image
label $wb-image -image approve/$ix -bd 2 -relief flat -bg black
manyset [dict2_reqkind_rows $dict] reqkind