4 # --------------------------------------------------------------------------
5 # Starting with Tcl 8.x, the BLT commands are stored in their own
6 # namespace called "blt". The idea is to prevent name clashes with
7 # Tcl commands and variables from other packages, such as a "table"
8 # command in two different packages.
10 # You can access the BLT commands in a couple of ways. You can prefix
11 # all the BLT commands with the namespace qualifier "blt::"
14 # blt::table . .g -resize both
16 # or you can import all the command into the global namespace.
18 # namespace import blt::*
20 # table . .g -resize both
22 # --------------------------------------------------------------------------
23 if { $tcl_version >= 8.0 } {
24 namespace import blt::*
25 #namespace import -force blt::tile::*
27 source scripts/demo.tcl
29 option add *Element.ScaleSymbols true
30 option add *Axis.loose true
31 option add *Pixels .8c
32 option add *Element.lineWidth 0
33 option add *Legend.ActiveRelief raised
34 option add *Legend.padY 0
35 option add *Button*Font { Courier 14 } widgetDefault
36 option add *Legend*Font { Courier 14 bold } widgetDefault
37 option add *Graph.Font { Courier 18 bold } widgetDefault
38 option add *Graph.title "Element Symbol Types"
39 option add *Graph.width 8i
40 option add *Graph.height 6i
41 option add *Graph.plotPadY .25i
42 option add *Graph.plotPadX .25i
48 vector create x -variable ""
49 x set { 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 }
51 for { set i 0 } { $i < 11 } { incr i } {
53 vector create ${vecName}
56 set y(:) [expr $i*100.0]
60 none "None" red red4 y0
61 arrow "Arrow" brown brown4 y10
62 circle "Circle" yellow yellow4 y2
63 cross "Cross" cyan cyan4 y6
64 diamond "Diamond" green green4 y3
65 plus "Plus" magenta magenta4 y9
66 splus "Splus" Purple purple4 y7
67 scross "Scross" red red4 y8
68 square "Square" orange orange4 y1
69 triangle "Triangle" blue blue4 y4
70 "@bitmaps/hobbes.xbm @bitmaps/hobbes_mask.xbm"
71 "Bitmap" yellow black y5
75 foreach {symbol label fill color yVec} $attributes {
76 $graph element create line${count} \
77 -label $label -symbol $symbol -color $color -fill $fill -x x -y $yVec
80 $graph element configure line0 -dashes { 2 4 2 } -linewidth 2
81 button .quit -text Quit -command exit
83 $graph 0,0 -fill both \
87 Blt_ActiveLegend $graph
88 Blt_ClosestPoint $graph