if 0 {[Richard Suchenwirth] 2004-08-25 - Users of [Toy cars] may appreciate this little utility - it makes designing new cars easier (one might even call it poor man's CAD :-). The Canvas items can be edited in the text widget at bottom. Click the "?" button to see how it looks, on the canvas above. Moving the cursor in the canvas shows the x/y coordinates in the window title. Clicking in the canvas inserts the x/y coordinates into the text widget, at insert position, so you can sketch out a polygon. The "<->" mirrors the car in x direction, so you can check how it looks "on the other side". The "C" button clears both canvas and text. [http://mini.net/files/steamroller.gif] When satisfied, just copy & paste into an editor that holds your car pool... The example shows a steamroller which sure looks a bit funny, cruising on the highway :) } proc render'car {text canvas} { $canvas delete all $canvas create line -200 0 200 0 -fill lightgrey $canvas create line 0 -100 0 100 -fill lightgrey foreach line [split [$text get 1.0 end] \n] { if {[string trim $line] eq ""} continue eval $canvas create $line -tag t } } proc center {w tag} { foreach {x0 y0 x1 y1} [$w bbox $tag] break list [expr {($x0+$x1)/2.}] [expr {($y0+$y1)/2.}] } proc int x {expr int($x)} pack [canvas .c -height 100] -fill x -expand 1 .c config -scrollregion {-100 -70 200 30} bind .c {wm title . [int [%W canvasx %x]],[int [%W canvasy %y]]} bind .c <1> {.t insert insert " [int [%W canvasx %x]] [int [%W canvasy %y]]"} pack [frame .f -relief sunken -borderwidth 1] -anchor w -fill x button .f.? -text ? -width 5 -command {render'car .t .c} button .f.<-> -text <-> -width 5 -command {eval .c scale t [center .c t] -1 1} button .f.c -text C -width 5 -command {.t delete 1.0 end; .c delete all} eval pack [winfo children .f] -side left pack [text .t -height 16] -fill both -expand 1 focus .t bind . {exec wish $argv0 &; exit} bind . {console show} ---- [Arts and crafts of Tcl-Tk programming]