8 .m1 add command -command { msel; puts hi } -label hi
9 .m3 add command -command { msel; puts boo } -label boo
11 image create bitmap ims -file gs_s.xbm
12 #image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm
17 settooltip "line\nanother"
19 fconfigure stdout -buffering line
23 proc innerwindow-destroying {} {
25 puts "DESTROYING $status"
26 switch -exact $status {
29 default { kill $status; set status old }
33 proc innerwindow-ready {} {
36 switch -exact $status {
44 error "unexpected state $status"
47 puts "READY-done $status"
53 global status ratelimit
55 puts "RUN-CHILD $status"
56 set now [clock seconds]
57 lappend ratelimit $now
58 while {[lindex $ratelimit 0] < {$now - 10}} {
59 set ratelimit [lrange $ratelimit 1 end]
61 if {[llength $ratelimit] > 10} {
62 puts stderr "crashing repeatedly, quitting $ratelimit"
67 set status [fork-then child-died {
68 execl xacpi-simple [list -into [winfo id .i.i.b.c]]
73 proc child-died {how how2} {
74 puts "DIED $how $how2"
76 switch -exact $status {
83 innerwindow-resetup-required "child died"