chiark / gitweb /
Factor out some common code in RETURN_RESULT into return_result_{start,finish} for...
[ypp-sc-tools.main.git] / pctb / dictionary-manager
index 10c87a83c0ac7810f4700190d71a9d8f71e01fc0..5904b4dfb7f57db8995510bb1d10c11fb67bd0ef 100755 (executable)
@@ -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