chiark / gitweb /
wip
[chiark-tcl-applet.git] / example
diff --git a/example b/example
index fe9794341f67fdb751d7e7f7a2b7e12198a35b38..4a6a16a2e886bbacfb88d9d6096f6383a97e1d27 100755 (executable)
--- a/example
+++ b/example
@@ -1,49 +1,28 @@
-#!/usr/bin/wish8.4
+#!/usr/bin/wish8.4 -f
+# -*- Tcl -*-
 
-#----- general machinery -----
+source applet.tcl
 
-package require tktray
-
-wm withdraw .
-
-image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm   
+#----- specifics -----
 
-tktray::icon .i -class example
-.i configure -docked 1
+.m1 add command -command { msel; puts hi } -label hi
+.m3 add command -command { msel; puts boo } -label boo
 
-set posted 0
+image create bitmap ims -file gs_s.xbm   
+#image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm   
+#setimage ims
+#setimage ims
 
-foreach b {1 3} {
-    menu .m$b -tearoff 0
-}
+setuptooltip
+settooltip "line\nanother"
 
-proc pressed {b x y} {
-    global posted
-    if {$posted == $b} {
-       puts "unpost $posted toggle"
-       .m$posted unpost
-       set posted 0
-    } elseif {[winfo exists .m$b]} {
-       if {$posted} {
-           .m$posted unpost
-           puts "unpost $posted other"
-       }
-       puts "post $b"
-       set posted $b
-       .m$b post $x $y
-    }
-}
+proc innerwindow {id} {
+    puts IICONFIG
+    puts "IC $id"
 
-proc msel {} {
-    global posted
-    set posted 0
+    .i.i.b configure -background darkblue -bd 1
+exec /home/ian/things/Chiark-utils/chiark-utils.git/cprogs/xacpi-simple \
+       -into $id &
 }
 
-bind .i <ButtonPress> { pressed %b %X %Y }
-
-#----- specifics -----
-
-.i configure -image ims
-.m1 add command -command { msel; puts hi } -label hi
-.m3 add command -command { msel; puts boo } -label boo
-
+setupinnerwindow 40