X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=example;h=bd05b1787c97e1eac55a04fbd26b9e3586f40613;hb=a145c2fb3db811efb0167b468d5a0026ba6716b8;hp=4a6a16a2e886bbacfb88d9d6096f6383a97e1d27;hpb=4a30ace4afa266ebcda72e88c96c611ad33feaae;p=chiark-tcl-applet.git diff --git a/example b/example index 4a6a16a..bd05b17 100755 --- a/example +++ b/example @@ -1,28 +1,32 @@ #!/usr/bin/wish8.4 -f # -*- Tcl -*- +# usage: +# xbatmon-simple-tray + source applet.tcl +source subproc.tcl + +applet::setup-debug puts -#----- specifics ----- +foreach b {1 3} { + applet::setup-button-menu $b +} -.m1 add command -command { msel; puts hi } -label hi -.m3 add command -command { msel; puts boo } -label boo +.m1 add command -command { applet::msel; puts hi } -label hi +.m3 add command -command { applet::msel; puts boo } -label boo -image create bitmap ims -file gs_s.xbm +#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 -setuptooltip -settooltip "line\nanother" - -proc innerwindow {id} { - puts IICONFIG - puts "IC $id" +applet::setup-tooltip { puts VIS } { puts INVIS } +applet::tooltip-set "line\nanother" - .i.i.b configure -background darkblue -bd 1 -exec /home/ian/things/Chiark-utils/chiark-utils.git/cprogs/xacpi-simple \ - -into $id & +proc cmdline {id orientation} { + global argv + return [concat $argv $id] } -setupinnerwindow 40 +applet::setup-subproc cmdline