3 set blt_library ../library
5 set blt_library ../library
6 set auto_path [linsert $auto_path 0 ../library]
8 # --------------------------------------------------------------------------
9 # Starting with Tcl 8.x, the BLT commands are stored in their own
10 # namespace called "blt". The idea is to prevent name clashes with
11 # Tcl commands and variables from other packages, such as a "table"
12 # command in two different packages.
14 # You can access the BLT commands in a couple of ways. You can prefix
15 # all the BLT commands with the namespace qualifier "blt::"
18 # blt::table . .g -resize both
20 # or you can import all the command into the global namespace.
22 # namespace import blt::*
24 # table . .g -resize both
26 # --------------------------------------------------------------------------
28 if { $tcl_version >= 8.0 } {
29 namespace import blt::*
30 namespace import -force blt::tile::*
33 source scripts/demo.tcl
35 image create photo bgTexture -file ./images/buckskin.gif
37 option add *Graph.Tile bgTexture
38 option add *Label.Tile bgTexture
39 option add *Frame.Tile bgTexture
40 option add *Htext.Tile bgTexture
41 option add *TileOffset 0
42 option add *HighlightThickness 0
43 option add *Element.ScaleSymbols no
44 option add *Element.Smooth linear
45 option add *activeLine.Color yellow4
46 option add *activeLine.Fill yellow
47 option add *activeLine.LineWidth 0
48 option add *Element.Pixels 3
49 option add *Graph.halo 7i
51 set visual [winfo screenvisual .]
52 if { $visual != "staticgray" } {
53 option add *print.background yellow
54 option add *quit.background red
57 proc FormatLabel { w value } {
64 graph $graph -title "Scatter Plot\n$length points"
65 $graph xaxis configure \
68 $graph yaxis configure \
70 $graph legend configure \
71 -activerelief sunken \
74 $graph element create line3 -symbol square -color green4 -fill green2 \
75 -linewidth 0 -outlinewidth 1 -pixels 4
76 table . .graph 0,0 -fill both
79 vector x($length) y($length)
83 $graph element configure line3 -x x -y y
89 Blt_ActiveLegend $graph
90 Blt_ClosestPoint $graph