From 664a9a255bb61dc84d6586487ab9ae9be41a84fd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 1 Jul 2009 20:52:57 +0100 Subject: [PATCH] Factor out some common code in RETURN_RESULT into return_result_{start,finish} for use by pixmap code too --- pctb/dictionary-manager | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/pctb/dictionary-manager b/pctb/dictionary-manager index 10c87a8..5904b4d 100755 --- a/pctb/dictionary-manager +++ b/pctb/dictionary-manager @@ -372,11 +372,13 @@ proc pixmap_maybe_ok {} { } proc pixmap_ok {} { global database ppm pixmap_selcol pixmap_selrow mainkind alloptions + + return_result_start 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] \ @@ -385,7 +387,8 @@ proc pixmap_ok {} { debug "UPDATE PIXMAP AS >$result<" do_database_update $ppm $result - done/$mainkind + + return_result_done } proc required/pixmap {} { @@ -939,17 +942,17 @@ proc update_database/DELETE {l r ctxs} { } write_database } - + proc RETURN_RESULT {how what} { - global mainkind + return_result_start + place forget .d.csr.csr pack forget .d.csr.csr.e - helptext {{{ Processing }}} - unbind_all_keys - update idletasks + debug "$how $what" eval update_database/$how $what - done/$mainkind + + return_result_done } #========== server for approving updates ========== @@ -1274,6 +1277,16 @@ proc approve_show_page {delta} { #========== main program ========== +proc return_result_start {} { + helptext {{{ Processing }}} + unbind_all_keys + update idletasks +} +proc return_result_finish {} { + global mainkind + done/$mainkind +} + proc main/default {} { puts stderr "Do not run this program directly." exit 12 -- 2.30.2