X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fdictionary-manager;fp=pctb%2Fdictionary-manager;h=19e067c93ba188a21222cb8411845ce19ef13b14;hb=a08a94640f4f0c02c536f337630dd234e917121f;hp=5e108a7ea72583e29a958ac60027dac37f73f845;hpb=d44517d863e2336f82299f7d3f5fcb68a84fe595;p=ypp-sc-tools.db-live.git diff --git a/pctb/dictionary-manager b/pctb/dictionary-manager index 5e108a7..19e067c 100755 --- a/pctb/dictionary-manager +++ b/pctb/dictionary-manager @@ -94,6 +94,13 @@ proc bgerror {m} { 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 @@ -422,10 +429,7 @@ proc required/pixmap {} { if {![string length $ppml]} break append ppm $ppml "\n" } - set tmpfile ./#dictimage#.tmp - exec pnmscale 2 << $ppm >$tmpfile - image create photo image/main -file $tmpfile - file delete $tmpfile + execpnm_createphoto image/main pnmscale 2 << $ppm set alloptions [exec ./database-info-fetch $unk_what] @@ -702,11 +706,9 @@ proc char_read_pgm {f} { 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 ---------- @@ -1205,9 +1207,7 @@ proc approve_showentry {ix file specdata} { 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 2 << $image label $wb-image -image approve/$ix -bd 2 -relief flat -bg black manyset [dict2_reqkind_rows $dict] reqkind