10 applet::setup-button-menu $b
13 .m1 add command -command { applet::msel; puts hi } -label hi
14 .m3 add command -command { applet::msel; puts boo } -label boo
16 #image create bitmap ims -file gs_s.xbm
17 #image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm
21 applet::setup-tooltip { puts VIS } { puts INVIS }
22 applet::tooltip-set "line\nanother"
24 fconfigure stdout -buffering line
28 proc innerwindow-destroying {} {
30 puts "DESTROYING $status"
31 switch -exact $status {
34 default { kill $status; set status old }
38 proc innerwindow-ready {} {
41 switch -exact $status {
49 error "unexpected state $status"
52 puts "READY-done $status"
58 global status ratelimit
60 puts "RUN-CHILD $status"
61 set now [clock seconds]
62 lappend ratelimit $now
63 while {[lindex $ratelimit 0] < {$now - 10}} {
64 set ratelimit [lrange $ratelimit 1 end]
66 if {[llength $ratelimit] > 10} {
67 puts stderr "crashing repeatedly, quitting $ratelimit"
72 set status [subproc::fork child-died {
73 execl xacpi-simple [list -into [winfo id .i.i.b.c]]
78 proc child-died {how how2} {
79 puts "DIED $how $how2"
81 switch -exact $status {
88 innerwindow-resetup-required "child died"