1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
#!../bltwish
source bltDemo.tcl
option add *Graph.Tile bgTexture
option add *Label.Tile bgTexture
option add *Frame.Tile bgTexture
option add *Htext.Tile bgTexture
option add *TileOffset 0
option add *HighlightThickness 0
option add *takeFocus yes
option add *shadow orange2
#option add *titleColor orange2
set visual [winfo screenvisual .]
if { $visual != "staticgray" } {
option add *print.background yellow
option add *quit.background red
}
image create photo bgTexture -file ./images/buckskin.gif
set remote {}
set graph .graph
option add *tile bgTexture
option add *psPreview yes
option add *psLandscape yes
option add *psMaxpect yes
option add *psCenter yes
htext .header -text {\
This is an example of the graph widget. It displays two-variable data
with assorted line attributes and symbols. To create a postscript file
"xy.ps", press the %%
button $htext(widget).print -text print -command {
puts stderr [time {.graph postscript output xy.ps}]
}
$htext(widget) append $htext(widget).print
%% button.}
source graph1.tcl
htext .footer -text {Hit the %%
button $htext(widget).quit -text quit -command {
catch "send GraphConfig after 1 exit"
exit
}
$htext(widget) append $htext(widget).quit
%% button when you've seen enough.%%
label $htext(widget).logo -bitmap BLT
$htext(widget) append $htext(widget).logo -padx 20
%%}
table . \
.header 0,0 -fill x \
.graph 1,0 -fill both \
.footer 2,0 -fill x
table configure . r0 r2 -resize none
wm min . 0 0
$graph element bind all <Enter> {
%W legend activate [%W element get current]
}
$graph element bind all <Leave> {
%W legend deactivate [%W element get current]
}
$graph marker bind Text <B2-Motion> {
set coords [%W invtransform %x %y]
catch { %W marker configure [%W marker get current] -coords $coords }
}
$graph marker bind fred <Enter> {
set marker [%W marker get current]
catch { %W marker configure $marker -fill green}
}
$graph marker bind fred <Leave> {
set marker [%W marker get current]
catch { %W marker configure $marker -fill ""}
}
# $graph marker create polygon \
# -coords { 0 200 1 300 2 200 3 200 4 300 5 200 } \
# -name xPolygon -linewidth 0 \
# -fill red -outline blue
$graph marker create text -bindtags "fred Text all" -name Test\
-text "Move with \nmouse button #2" -coords "3.0 150.0" \
-anchor center -bg red
|