X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fdictionary-manager;h=5e108a7ea72583e29a958ac60027dac37f73f845;hb=d44517d863e2336f82299f7d3f5fcb68a84fe595;hp=53174ed25cd57e7167b17cfad75100f54d4ed64f;hpb=057a860424fc2ebe1fdfae422b67cdfcc1da8cd4;p=ypp-sc-tools.web-live.git diff --git a/pctb/dictionary-manager b/pctb/dictionary-manager index 53174ed..5e108a7 100755 --- a/pctb/dictionary-manager +++ b/pctb/dictionary-manager @@ -145,6 +145,7 @@ static unsigned char csr_bits[] = { button .pe.ok -text OK pack .pe.grid .pe.ok -side left + bind .pe.ok { .pe.ok invoke } pack .d.mi .d.ctx -side top -anchor w pack .d -fill x -padx 2 -pady 2 @@ -366,7 +367,9 @@ proc pixmap_select {ncol} { 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 @@ -382,8 +385,10 @@ proc pixmap_maybe_ok {} { 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 {} { @@ -417,8 +422,10 @@ proc required/pixmap {} { if {![string length $ppml]} break append ppm $ppml "\n" } - set data [exec pnmscale 2 << $ppm] - image create photo image/main -data $data + set tmpfile ./#dictimage#.tmp + exec pnmscale 2 << $ppm >$tmpfile + image create photo image/main -file $tmpfile + file delete $tmpfile set alloptions [exec ./database-info-fetch $unk_what] @@ -452,7 +459,7 @@ proc required/pixmap {} { 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.}} } } @@ -731,7 +738,7 @@ proc startup_cursor {} { global glyphsdone unk_l unk_r set cur_already [expr {[llength $glyphsdone]/5-1}] - set cur_mode 1 ;# one of: 0 1 already text + set cur_mode 0 ;# one of: 0 1 already text set cur_0 $unk_l set cur_1 [expr {$unk_r+1}] @@ -1249,6 +1256,8 @@ proc approve_check_server {} { proc approve_confirm {} { global approve_ixes approve_entryhow + .ok configure -state disabled + update idletasks approve_check_server foreach ix $approve_ixes { set how $approve_entryhow($ix) @@ -1283,6 +1292,7 @@ proc approve_fetch_list {} { set approve_list [lsort -command approve_compare $approve_list] approve_show_page 0 + .ok configure -state normal } proc main/approve {} {