programs
#> ENTRY key=val #> SCALE key=val from:to:step #> RADIO key=val opt1,opt2,opt3,... #> CHECK key=val opt1,opt2,opt3,... #> IFILE key=val #> OFILE key=val #> IDIR key=val #> ODIR key=val #< -tkopt1 tkval1 -tkopt2 -tkval2 ... # #> HELP key One-line helpers for this particular keyword # #> -EXEC # any code inbetween here is not executed by tkrun #> +EXEC #It is also possible to put these lines on the same line as the shell variable in e.g. c-shell scripts, e.g.:
set a=1 #> SCALE a=1 0:10:0.1but this is a new feature and will possibly be modified to not have to specify the variable setting "a=1" twice.
In the upcoming tkrun V2 version
of this format is expected to allow help, as well as normalize the keyword
specification as follows:
set a=1 # some help on this keyword #> SCALE 0:10:0.1
checkbuttons and radiobuttons do not layout their buttons efficiently, and the overal layout is limited to fit your (vertical) screensize. Planned fix is to use the grid(3) geometry manager, instead of pack(3) .
The additional Tcl/Tk options (on a #< line immediately following the #> line) are not working.
The code is horribly non-defensive, and does not handle syntax errors on the #> tag lines very well.
% tkrun -e > try1.csh % chmod +x try1.csh % tkrun ./try1.csh
And more:
% tkrun designWould create a Tcl/Tk script called ‘‘design.tk’’, extract keyword info and run this script, which in turn will call ‘‘design’’ with your selection of ‘‘keyword=value’’ pairs.
% tkrun -r tsf itemize.cshparses the GUI elements from itemize.csh, and will call the tsf program.
Here is a very simple script, called testscript in the source code distribution:
#! /bin/csh -f # # here are some basic GUI elements # #> IFILE in= #> OFILE out= #> ENTRY eps=0.01 #> RADIO mode=gauss gauss,newton,leibniz #> CHECK options=mean,sigma sum,mean,sigma,skewness,kurtosis #> SCALE n=3.141592 0:10:0.01 #< -digits 2 # parse named arguments foreach a ($*) set $a end #> -EXEC echo If this is executed, tkrun does not work properly yet #> +EXEC echo ARGS: in=$in out=$out eps=$eps mode=$mode options=$options n=$n echo TESTSCRIPT echo 0 : $0 set count=0 again: if ($#argv == 0) exit 0 @ count++ echo $count : shift argv goto again
key=val # help #> GUIspecification, but the client software (bash/csh/python/....) is responsible to properly parse the key=val command line arguments. Here are the proposed
GUI tags with generic key=val/help sections
in=foo # input file #> IFILE out=bar # output file #> OFILE text=hello # some text #> ENTRY mode=gauss # the mode #> RADIO gauss,newton,leibniz stats=mean # what to show #> CHECK sum,mean,sigma,skewness,kurtosis n=3.141592 # the n value #> SCALE 0:10:0.01 k=3.141592 # k, use n #> LINK n
http://sunscript.sun.com/ Home Page of Tcl/Tk (now gone) http://www.neosoft.com/ Archive of Tcl/Tk tools http://tcl.sourceforge.net/ Current home page and source code repo
~/.tkrunrc (optional) global configuration file $run.key keyword file in which key=val pairs are maintained $NEMO/scripts/templates example templates of key=val parsing
18-aug-97 V0.1 released for ADASS97 paper (tcl/tk 7.6/4.2) PJT 30-jan-98 V0.2 added -e, and some minor features PJT 22-apr-04 V1.2 added option to share the set and #> comment on one line PJT 12-jun-08 V1.4 updated doc and minor code cleanup PJT 24-dec-09 V1.7 implemented the load/save of key=val files PJT 14-jul-2023 rudimentary tooltips 3-aug-2023 proposing the new V2 GUI format PJT