chiark / gitweb /
do not destroy .i.i.make-exist, since this sometimes causes trouble
[chiark-tcl-applet.git] / example
diff --git a/example b/example
index 57e87083d5bf1a19d295895efac94dbd50749e6a..2d07e86d135c6cb5a952452febc8c9f1af4c86e0 100755 (executable)
--- a/example
+++ b/example
@@ -1,14 +1,33 @@
-#!/usr/bin/wish8.4
+#!/usr/bin/wish8.4 -f
+# -*- Tcl -*-
+
+# usage:
+#  xbatmon-simple-tray
 
 source applet.tcl
+source subproc.tcl
+source utils.tcl
+
+set debug::debug puts
+
+foreach b {1 3} {
+    applet::setup-button-menu $b
+}
+
+.m1 add command -command { applet::msel; puts hi } -label hi
+.m3 add command -command { applet::msel; puts boo } -label boo
 
-#----- specifics -----
+#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
 
-.m1 add command -command { msel; puts hi } -label hi
-.m3 add command -command { msel; puts boo } -label boo
+applet::setup-tooltip { puts VIS } { puts INVIS }
+applet::tooltip-set "line\nanother"
 
-image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm   
-setimage ims
+proc cmdline {id orientation} {
+    global argv
+    return [concat $argv $id]
+}
 
-setuptooltip
-settooltip "line\nanother"
+applet::setup-subproc cmdline