X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fshow-thing.tcl;h=0d2ec0c94ba202998858e3e539dc3673c3020bbf;hb=cd6a4f773c32f73aff27f97e8994c6b7c1019bb7;hp=3d42218619359f68e864dc72c2923a880d415ff0;hpb=228064d752783de516994b2e38d7bca59507eefc;p=ypp-sc-tools.db-test.git diff --git a/pctb/show-thing.tcl b/pctb/show-thing.tcl index 3d42218..0d2ec0c 100755 --- a/pctb/show-thing.tcl +++ b/pctb/show-thing.tcl @@ -401,20 +401,20 @@ proc update_database/DELETE {l r ctx} { proc RETURN_RESULT {how what} { + global mainkind place forget .d.csr.csr pack forget .d.csr.csr.e helptext {{{ Processing }}} unbind_all_keys update idletasks - puts "$how $what" + puts stderr "$how $what" eval update_database/$how $what - exec kill -STOP [pid] - fileevent stdin readable required + done/$mainkind } #---------- main progrm ---------- -proc test_main {} { +proc main/test {} { global glyphsdone unk_l unk_r unk_context set glyphsdone { @@ -433,6 +433,8 @@ proc test_main {} { draw_glyphsdone startup_cursor } +proc done/test {} { +} proc required {} { global glyphsdone unk_l unk_r unk_context @@ -444,7 +446,7 @@ proc required {} { init_widgets manyset [lrange $l 0 3] unk_l unk_r unk_context set glyphsdone [lrange $l 3 end] - puts "SHOW-THING GOT $l" + puts stderr "SHOW-THING GOT $l" fileevent stdin readable {} @@ -453,6 +455,21 @@ proc required {} { startup_cursor } +proc main/automatic {} { + fconfigure stdin -blocking no + fileevent stdin readable required +} +proc done/automatic {} { + exec sh -c {printf \\0 >&4} + fileevent stdin readable required +} + +switch -exact -- $argv { + {} { set mainkind test } + {--automatic 1} { set mainkind automatic } + {--automatic*} { error "incompatible versions - install problem" } + default { error "huh $argv ?" } +} + read_database -fconfigure stdin -blocking no -fileevent stdin readable required +main/$mainkind