chiark / gitweb /
1d234892150dcf8d39949a2adb743cfa92996a73
[chiark-tcl-applet.git] / example
1 #!/usr/bin/wish8.4 -f
2 # -*- Tcl -*-
3
4 # Copyright 2016,2020 Ian Jackson
5 # SPDX-License-Identifier: GPL-3.0-or-later
6 # There is NO WARRANTY.
7
8 # usage:
9 #  xbatmon-simple-tray
10
11 source applet.tcl
12 source subproc.tcl
13 source utils.tcl
14
15 set debug::debug puts
16
17 foreach b {1 3} {
18     applet::setup-button-menu $b
19 }
20
21 .m1 add command -command { applet::msel; puts hi } -label hi
22 .m3 add command -command { applet::msel; puts boo } -label boo
23
24 #image create bitmap ims -file gs_s.xbm   
25 #image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm   
26 #setimage ims
27 #setimage ims
28
29 applet::setup-tooltip { puts VIS } { puts INVIS }
30 applet::tooltip-set "line\nanother"
31
32 proc cmdline {id orientation} {
33     global argv
34     return [concat $argv $id]
35 }
36
37 applet::setup-subproc cmdline