1#! /bin/sh 2# -*- tcl -*- \ 3exec tclsh "$0" ${1+"$@"} 4 5package require Tcl 8.4 6package require Tk 7 8package require Plotchart 9 10# plotdemos3.tcl -- 11# Show a Gantt chart 12# 13 14canvas .c -width 500 -height 200 -bg white 15pack .c -fill both 16.c delete all 17 18set s [::Plotchart::createGanttchart .c "1 january 2004" \ 19 "31 december 2004" 4] 20 21set from [$s task "Spring" "1 march 2004" "1 june 2004" 30] 22set to [$s task "Summer" "1 june 2004" "1 september 2004" 10] 23$s summary "First half" $from $to 24$s connect $from $to 25$s vertline "1 jan" "1 january 2004" 26$s vertline "1 apr" "1 april 2004" 27$s vertline "1 jul" "1 july 2004" 28$s vertline "1 oct" "1 october 2004" 29$s milestone "Longest day" "21 july 2004" 30$s title "Seasons (northern hemisphere)" 31 32# 33# Copy the thing: 34# Should result in this configuration: 35# = = 36# = 37toplevel .t 38canvas .t.c -width 700 -height 500 39pack .t.c 40::Plotchart::plotpack .t.c top $s $s 41::Plotchart::plotpack .t.c left $s 42