X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=pctb%2Fshow-thing.tcl;h=5356c3292c7c58a276944752d6b16c325b1f5090;hp=c04d4ddf21b897e56d323e0c1ac17d40a14f8ea3;hb=09e8b6a8735c8cd1f7f3ffbabc1a05f0a8f8ca75;hpb=d3eaa28d304c5b0639bc0f7e29b3285317d5c1e7 diff --git a/pctb/show-thing.tcl b/pctb/show-thing.tcl index c04d4dd..5356c32 100755 --- a/pctb/show-thing.tcl +++ b/pctb/show-thing.tcl @@ -26,10 +26,6 @@ set gotsh 20 set csrh 20 set ctxh 20 -proc debug {m} { - puts stderr "SHOW-THING $m" -} - proc init_widgets {} { # idempotent global csrh gotsh ctxh @@ -525,6 +521,7 @@ proc required {} { debug "GOT $l" fileevent stdin readable {} + fconfigure stdin -blocking yes read_xpm stdin resize_widgets @@ -539,14 +536,20 @@ proc main/automatic {} { } proc done/automatic {} { exec sh -c {printf \\0 >&4} - fileevent stdin readable required + main/automatic } -switch -exact -- $argv { - {} { set mainkind test } - {--automatic 1} { set mainkind automatic } - {--automatic*} { error "incompatible versions - install problem" } - default { error "huh $argv ?" } +proc debug {m} { } + +set mainkind test +foreach arg $argv { + switch -exact -- $arg { + {--debug} { proc debug {m} { puts stderr "SHOW-THING $m" } } + {--noop-arg} { } + {--automatic-1} { set mainkind automatic } + {--automatic*} { error "incompatible versions - install problem" } + default { error "huh $argv ?" } + } } main/$mainkind