From: Ian Jackson Date: Sat, 4 Jul 2009 20:02:15 +0000 (+0100) Subject: Permit Return instead of clicking on pixmap selection X-Git-Tag: 1.9.2~12 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=ea545ac6f88b00d59721205d6cd60a3528a1bab2 Permit Return instead of clicking on pixmap selection --- diff --git a/pctb/dictionary-manager b/pctb/dictionary-manager index c1e983b..ad05c6b 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 {} { @@ -452,7 +457,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.}} } }