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 99 100 101 102 103 104 105 106 107
|
package require BLT
set count 0
set img [image create picture -file images/buckskin.gif]
proc BuildControls { bg } {
global count
blt::tk::frame .f$count -bg $bg -width 200 -height 200
blt::tk::button .f$count.l -text "Background $count" -bg $bg \
-highlightbackground $bg -highlightthickness 10
blt::table .f$count \
$count,0 .f$count.l -padx 20 -pady 20 -fill both
blt::table . \
$count,0 .f$count -fill both
incr count
}
proc LinearGradientBackground { args } {
global count
set bg [eval blt::background create linear $args -relativeto .f$count]
BuildControls $bg
}
proc RadialGradientBackground { args } {
global count
set bg [eval blt::background create radial $args -relativeto .f$count]
BuildControls $bg
}
proc TileBackground { args } {
global count
set bg [eval blt::background create tile $args -relativeto .f$count]
BuildControls $bg
}
proc ConicalGradientBackground { args } {
global count
set bg [eval blt::background create conical $args -relativeto .f$count]
BuildControls $bg
}
proc CheckerBackground { args } {
global count
set bg [eval blt::background create checker $args -relativeto .f$count]
BuildControls $bg
}
proc StripeBackground { args } {
global count
set bg [eval blt::background create stripe $args -relativeto .f$count]
BuildControls $bg
}
proc ColorBackground {} {
global count
set bg lightgreen
BuildControls $bg
}
LinearGradientBackground \
-jitter 3 \
-from n \
-to s \
-colorscale linear \
-lowcolor "grey97"\
-highcolor "grey80"\
-palette spectral.rgb \
-repeat reversing
RadialGradientBackground \
-colorscale log \
-center { 0.2 0.8} \
-width 3.0 \
-height 3.0 \
-lowcolor "grey97"\
-highcolor "grey80"\
-palette spectral.rgb \
-repeat reversing \
ConicalGradientBackground \
-lowcolor "grey97"\
-highcolor "grey80"
TileBackground \
-image $img \
-jitter 2 \
-xoffset 0 \
-border brown
StripeBackground \
-jitter 3
CheckerBackground \
-jitter 3
ColorBackground
|