Version 0 of Xmas tree

Updated 2005-12-22 11:00:06 by suchenwi

Richard Suchenwirth 2005-12-22 - Ho ho ho, here we go:

http://mini.net/files/xmas.jpg

 package require Tk
 pack [canvas .c -width 200 -height 300 -background darkblue]
 .c create rect 95 250 105 280 -fill brown
 .c create rect 70 270 130 290 -fill black
 foreach dx {40 55 70 85 100} y {20 60 100 140 180} {
    .c create poly 100 $y [expr 100-$dx] [expr $y+70] \
        [expr 100+$dx] [expr $y+70] -fill darkgreen
    .c create rect [expr 108-$dx] [expr $y+45] \
        [expr 112-$dx] [expr $y+65] -fill red
    .c create oval [expr 107-$dx] [expr $y+36] \
        [expr 113-$dx] [expr $y+44] -fill yellow
    .c create rect [expr 88+$dx] [expr $y+45] \
        [expr 92+$dx] [expr $y+65] -fill red
    .c create oval [expr 87+$dx] [expr $y+36] \
        [expr 93+$dx] [expr $y+44] -fill yellow
 }

Category Example | Arts and crafts of Tcl-Tk programming