OSDN Git Service

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