blob: 016e02da28a302808a5b9a651bde1bf58ad9ced5 (
plain)
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
|
# these simple samples have been developped by C. Mertz mertz@cena.fr in perl
# tcl version by Jean-Paul Imbert imbert@cena.fr
if {![info exists zincDemo]} {
error "This script should be run from the zinc-widget demo."
}
set w .colorCircular
catch {destroy $w}
toplevel $w
wm title $w "Zinc Color Circular Demonstration"
wm iconname $w "Color Circular"
frame $w.buttons
pack $w.buttons -side bottom -fill x -pady 2m
button $w.buttons.dismiss -text Dismiss -command "destroy $w"
button $w.buttons.code -text "See Code" -command "showCode $w"
pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
set defaultfont "-adobe-helvetica-bold-r-normal-*-120-*-*-*-*-*-*"
zinc $w.zinc -width 700 -height 600 -borderwidth 3 -relief sunken -render 1
pack $w.zinc
$w.zinc add rectangle 1 {10 10 80 80} -fillcolor {red|blue 50 50} -filled 1
$w.zinc add text 1 -font $defaultfont -text "Radial variation from non-transparent red to non-transparent blue\nin a squarre. The gradient starts from the lower right corner.\n" -anchor nw -position {120 20}
$w.zinc add arc 1 {10 110 90 190} -fillcolor {red;40|blue;40 0 25} -filled 1
$w.zinc add text 1 -font $defaultfont -text "Radial variation from 40%transparent red to 40% transparent blue\nin a disc. The gradient starts in the middle between\nthe center on the bottom point" -anchor nw -position {120 120}
$w.zinc add arc 1 {10 210 90 290} -fillcolor {red;40|green;40 50|blue;40 0 0} -filled 1
$w.zinc add text 1 -font $defaultfont -text "A variation from 40%transparent red to 40% transparent blue.\nthrough a 40%green on the middle of the disc. The gradient is centered." -anchor nw -position {120 220}
$w.zinc add text 1 -font $defaultfont -text "Two overlaping radialy transparently colored items on a white background" -anchor nw -position {20 320}
$w.zinc add rectangle 1 {10 340 690 590} -fillcolor white -filled 1
$w.zinc add rectangle 1 {20 365 220 565} -fillcolor {red;40|green;40 50|blue;40 0 0} -filled 1
$w.zinc add arc 1 {150 365 350 565} -fillcolor {yellow;40|black;40 50|cyan;40 0 0} -filled 1
$w.zinc add arc 1 {280 365 480 565} -fillcolor {black;100|black;100 20|white;40 0 0} -filled 1 -linewidth 0
$w.zinc add arc 1 {480 365 580 500} -fillcolor {black;100|white;40 -10 16} -filled 1
$w.zinc add arc 1 {580 410 680 580} -fillcolor {black;70|white;20 -40 -40} -filled 1
$w.zinc add arc 1 {580 410 680 580} -fillcolor {black;70|white;20 40 40} -filled 1
|