X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=example;h=7cf6b15111ecee755463996772bece81ca484260;hb=9ab567c4ba2e3627372f9b39733297ac3df93fb4;hp=a22ab0bc840914b1f2720180c19111418b390e83;hpb=213cbca6ba6d566edbd8bb78d56bbdb6a3950a63;p=chiark-tcl-applet.git diff --git a/example b/example index a22ab0b..7cf6b15 100755 --- a/example +++ b/example @@ -1,10 +1,26 @@ -#!/usr/bin/wish8.4 -f +#!/usr/bin/wish -f # -*- Tcl -*- -source applet.tcl -source subproc.tcl +# Copyright 2016,2020 Ian Jackson +# SPDX-License-Identifier: GPL-3.0-or-later +# There is NO WARRANTY. -applet::setup-debug puts +# usage: +# .../example program arguments... +# will run +# program arguments... WINDOWID +# and program sbould put up an X11 window as a child of WINDOWID +# +# eg, for a silly example: +# .../example xterm -id + +set lib . + +source $lib/applet.tcl +source $lib/subproc.tcl +source $lib/utils.tcl + +set debug::debug puts foreach b {1 3} { applet::setup-button-menu $b @@ -21,8 +37,9 @@ foreach b {1 3} { applet::setup-tooltip { puts VIS } { puts INVIS } applet::tooltip-set "line\nanother" -proc cmdline {id} { - return [list xacpi-simple -into $id] +proc cmdline {id orientation} { + global argv + return [concat $argv $id] } -applet::setup-subproc 40 darkblue 1 cmdline +applet::setup-subproc cmdline