
destroy .traceopt
toplevel .traceopt
wm title .traceopt "GOBLIN Tracing Options"
wm resizable .traceopt 0 0
     
frame .traceopt.f1
    label .traceopt.f1.label -text "Trace Level:" -anchor w
    radiobutton .traceopt.f1.noTracing -text "No Tracing" \
        -variable goblinTraceLevel -value 0 -anchor w
    radiobutton .traceopt.f1.constructors -text "Trace Constructors" \
        -variable goblinTraceLevel -value 2 -anchor w
    radiobutton .traceopt.f1.exhaustive -text "Exhaustive Tracing" \
        -variable goblinTraceLevel -value 3 -anchor w
    pack .traceopt.f1.label .traceopt.f1.noTracing .traceopt.f1.constructors \
        .traceopt.f1.exhaustive -side top -fill x
     
checkbutton .traceopt.data -text "Trace High Level Data Structures" \
    -variable goblinTraceData -anchor w

frame .traceopt.f3
     
    label .traceopt.f3.traceStepText -text "Trace Step:" -anchor w
    grid .traceopt.f3.traceStepText -in .traceopt.f3  \
        -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news -padx 1m
    entry .traceopt.f3.traceStep -textvariable goblinTraceStep -bg white -width 5
    grid .traceopt.f3.traceStep -in .traceopt.f3 \
        -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news -padx 1m

    label .traceopt.f3.thresholdText -text "Threshold:" -anchor w
    grid .traceopt.f3.thresholdText -in .traceopt.f3  \
        -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news -padx 1m
    entry .traceopt.f3.threshold -textvariable goblinThreshold -bg white -width 5
    grid .traceopt.f3.threshold -in .traceopt.f3 \
        -row 1 -column 1 -rowspan 1 -columnspan 1 -sticky news -padx 1m

    grid rowconfig    .traceopt.f3 0 -weight 1 -minsize 0
    grid columnconfig .traceopt.f3 0 -weight 1 -minsize 0
    
frame .traceopt.buttons
    button .traceopt.buttons.restart -text "Restart" -command {
        RestartEngine
    }

    button .traceopt.buttons.done -text "Done" -command {
        if {[QualifiedInt $goblinTraceStep 1 50000] && \
            [QualifiedInt $goblinThreshold 0 50000]} {destroy .traceopt}
    }
    
    pack .traceopt.buttons.restart \
        .traceopt.buttons.done \
        -side left -fill x -padx 3m
     
pack .traceopt.buttons -padx 3m -pady 3m -side bottom
pack .traceopt.f1 .traceopt.data .traceopt.f3 -padx 10m -pady 5m -side top -anchor w
