9 applet::setup-button-menu $b
12 .m1 add command -command { msel; puts hi } -label hi
13 .m3 add command -command { msel; puts boo } -label boo
15 #image create bitmap ims -file gs_s.xbm
16 #image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm
20 applet::setup-tooltip { puts VIS } { puts INVIS }
21 applet::tooltip-set "line\nanother"
23 fconfigure stdout -buffering line
27 proc innerwindow-destroying {} {
29 puts "DESTROYING $status"
30 switch -exact $status {
33 default { kill $status; set status old }
37 proc innerwindow-ready {} {
40 switch -exact $status {
48 error "unexpected state $status"
51 puts "READY-done $status"
57 global status ratelimit
59 puts "RUN-CHILD $status"
60 set now [clock seconds]
61 lappend ratelimit $now
62 while {[lindex $ratelimit 0] < {$now - 10}} {
63 set ratelimit [lrange $ratelimit 1 end]
65 if {[llength $ratelimit] > 10} {
66 puts stderr "crashing repeatedly, quitting $ratelimit"
71 set status [fork-then child-died {
72 execl xacpi-simple [list -into [winfo id .i.i.b.c]]
77 proc child-died {how how2} {
78 puts "DIED $how $how2"
80 switch -exact $status {
87 innerwindow-resetup-required "child died"