set f2 [ttk::frame $p2.f2]
grid $f2 -row 1 -sticky w

# glyph matrix boxhead
set r 0
set c 0
set boxhead "Conditions $recipes"
foreach h $boxhead {
    ttk::label $f2.lhead_$h -text $h
    grid $f2.lhead_$h -row $r -column $c
    incr c
}

# glyph matrix stub
set r 1
set c 0
foreach cond $conds {
    ttk::label $f2.lcond_$cond -text $cond
    grid $f2.lcond_$cond -row $r -column $c -sticky w
    incr r
}
ttk::label $f2.con -text Consistency
ttk::label $f2.cov -text "Raw coverage"
ttk::label $f2.ucov -text "Unique coverage"
grid $f2.con -row $r -column $c -sticky w
incr r
grid $f2.cov -row $r -column $c -sticky w
incr r
grid $f2.ucov -row $r -column $c -sticky w

# delimiter that won't accidentally be used by a user
set DELIM \x1F

# glyph matrix body
set c 1
foreach rec $recipes {
    set r 1
    foreach cond $conds {
	# cell
	ttk::menubutton $f2.mb$r$c -textvariable "gm($rec $DELIM $cond)" -width 9
	grid $f2.mb$r$c -row $r -column $c

	# drop down menu
	set m [menu $f2.mb$r$c.menu -tearoff 0]
	$f2.mb$r$c configure -menu $m
	$m add radiobutton -value Corepos -variable "gm($rec $DELIM $cond)" -label Corepos
	$m add radiobutton -value Coreneg -variable "gm($rec $DELIM $cond)" -label Coreneg
	$m add radiobutton -value Contribpos -variable "gm($rec $DELIM $cond)" -label Contribpos
	$m add radiobutton -value Contribneg -variable "gm($rec $DELIM $cond)" -label Contribneg
	$m add radiobutton -value Necpos -variable "gm($rec $DELIM $cond)" -label Necpos
	$m add radiobutton -value Necneg -variable "gm($rec $DELIM $cond)" -label Necneg
	$m add radiobutton -value - -variable "gm($rec $DELIM $cond)" -label Irrelevant

	incr r
    }
    # concov fields
    set "gm($rec $DELIM con)" {}
    ttk::entry $f2.econ$r$c -textvariable "gm($rec $DELIM con)" -width 9
    grid $f2.econ$r$c -row $r -column $c -sticky ew

    incr r
    set "gm($rec $DELIM cov)" {}
    ttk::entry $f2.ecov$r$c -textvariable "gm($rec $DELIM cov)" -width 9
    grid $f2.ecov$r$c -row $r -column $c -sticky ew

    incr r
    set "gm($rec $DELIM ucov)" {}
    ttk::entry $f2.eucov$r$c -textvariable "gm($rec $DELIM ucov)" -width 9
    grid $f2.eucov$r$c -row $r -column $c -sticky ew

    incr c
}

# button
set bcreate [ttk::button $p2.bcreate -text "Create Fiss Chart" -default active -command {
		
    validateGM
    
    set s {}
    append s [solStanza] \n
    append s [recipesStanza] \n
    append s [boxheadStanza] \n
    append s [stubStanza] \n
    append s {title "Fiss Configuration Chart"} \n
    
    puts $s
    destroy .
}]

grid $bcreate -sticky we

