X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fshow-thing.tcl;fp=pctb%2Fshow-thing.tcl;h=142ab42a712555be20539c2ddf014cd1c1d268cc;hb=7198105eceff39cb71cd432312e0e9c82139d7b1;hp=0b0b8f553616109d21da2d96a99f70bf33809a1f;hpb=19d9fa719b3d1658a96b422161f0879d6b696664;p=ypp-sc-tools.db-test.git diff --git a/pctb/show-thing.tcl b/pctb/show-thing.tcl index 0b0b8f5..142ab42 100755 --- a/pctb/show-thing.tcl +++ b/pctb/show-thing.tcl @@ -26,7 +26,10 @@ set gotsh 20 set csrh 20 proc init_widgets {} { + # idempotent global csrh gotsh + + if {[winfo exists .d]} return frame .d @@ -176,6 +179,8 @@ proc startup_cursor {} { set cur_0 $unk_l set cur_1 [expr {$unk_r+1}] set last_ht {} + + recursor } @@ -403,9 +408,11 @@ proc RETURN_RESULT {how what} { update idletasks puts "$how $what" eval update_database/$how $what + exec kill -STOP [pid] + fileevent stdin readable required } -# bind . {} +#---------- main progrm ---------- proc test_main {} { global glyphsdone unk_l unk_r unk_context @@ -427,7 +434,25 @@ proc test_main {} { startup_cursor } +proc required {} { + global glyphsdone unk_l unk_r unk_context + + if {[gets stdin l]<0} { + if {[eof stdin]} { fconfigure stdin -blocking yes; exit 0 } + return + } + init_widgets + manyset [lrange $l 0 3] unk_l unk_r unk_context + set glyphsdone [lrange $l 3 end] + puts "SHOW-THING GOT $l" + + fileevent stdin readable {} + + read_xpm stdin + draw_glyphsdone + startup_cursor +} + read_database -init_widgets -test_main -recursor +fconfigure stdin -blocking no +fileevent stdin readable required