#!../bltwish

source bltDemo.tcl

set graph .graph

bitmap define pattern1 { {4 4} {01 02 04 08} }
bitmap define pattern5 { {4 4} {01 01 01 01} }

set visual [winfo screenvisual .]
if { $visual != "staticgray" && $visual != "grayscale" } {
    option add *Button.Background		red
    option add *TextMarker.Foreground	black
    option add *TextMarker.Background	yellow
    option add *LineMarker.Foreground	black
    option add *LineMarker.Background	yellow
    option add *PolyMarker.Fill		yellow2
    option add *PolyMarker.Outline	""
    option add *PolyMarker.Stipple	pattern5
    option add *activeLine.Color	red4
    option add *activeLine.Fill		red2
    option add *Element.Color		purple
}

option add *HighlightThickness		0

image create photo bgTexture -file ./images/chalk.gif

option add *Text.font			-*-times*-bold-r-*-*-18-*-*
option add *header.font			-*-times*-medium-r-*-*-18-*-*
option add *footer.font			-*-times*-medium-r-*-*-18-*-*

option add *Tile		bgTexture
option add *Button.Tile		""

text .header -wrap word -width 0 -height 3

set text {
This is an example of a bitmap marker.  Try zooming in on 
a region by clicking the left button, moving the pointer, 
and clicking again.  Notice that the bitmap scales too. 
To restore the last view, click on the right button.  
}

regsub -all "\n" $text "" text
.header insert end "$text\n"
.header configure -state disabled

htext .footer -text {Hit the %%
    set im [image create photo -file ./images/stopsign.gif]
    button $htext(widget).quit -image $im -command { exit }
    $htext(widget) append $htext(widget).quit 
%% button when you've seen enough. %%
    label $htext(widget).logo -bitmap BLT
    $htext(widget) append $htext(widget).logo 
%%}

source graph3.tcl

table . \
    .header 0,0 -fill x -padx 4 -pady 4\
    .graph 1,0 -fill both  \
    .footer 2,0 -fill x -padx 4 -pady 4

table configure . r0 r2 -resize none

source bltGrPs.tcl

bind .graph <Shift-ButtonPress-1> { 
    MakePsLayout .graph
}

trace variable changed w GraphChanged

proc GraphChanged { args } {
    global changed
    trace vdelete changed w GraphChanged
    PsDialog .graph
}
