chiark / gitweb /
does some tooltips
[chiark-tcl-applet.git] / args.tcl
index fdcd59670050bdd87cbf9e530b2c381eb3ff41b3..c81118cbf091cede93aef94ff5d4365d59842fd0 100644 (file)
--- a/args.tcl
+++ b/args.tcl
@@ -6,9 +6,9 @@ proc badusage {msg} {
     exit 12
 }
 
-proc badoption {msg} {
+proc badoption {} {
     variable lastarg
-    badusage "unknown option $msg"
+    badusage "unknown option $lastarg"
 }
 
 proc next {} {
@@ -28,19 +28,14 @@ proc next_num {} {
     }
 }
 
-set w 50
-set h 50
-set orientation horizontal
-set bc darkblue
-set bw 1
-
-proc generalarg {} {
-    switch -exact $arg {
-       -width { set w [next_num] }
-       -height { set h [next_num] }
-       -horizontal - -vertical { set orientation $arg }
-       -borderColour - -borderColor { set bc [next] }
-       -borderWidth { set bw [next_num] }
+proc generalarg {arg} {
+    switch -exact -- $arg {
+       -width { set applet::w [next_num] }
+       -height { set applet::h [next_num] }
+       -horizontal - -vertical { set applet::deforient $arg }
+       -borderColour - -borderColor { set applet::border_colour [next] }
+       -borderWidth { set applet::border_width [next_num] }
+       -debug { debug::setup puts }
        default { return 0 }
     }
     return 1