#!/usr/local/bin/wish

set TkGnats(lib) ./; ##TKGNATSLIB##

source $TkGnats(lib)/tkpr_library.tcl

frame  .top

button .top.query \
        -relief raised \
        -text "Query Problem Reports" \
        -command {exec tkquerypr &; schedule_reap}

button .top.send \
        -relief raised \
        -text "Create Problem Report" \
        -command {exec tksendpr &; schedule_reap}

button .top.quit \
        -relief raised \
        -text "Quit" \
        -command {destroy .}

pack .top
pack .top.send .top.query -side top -fill x

pack [frame .top.space1] -side top -fill x -pady 5

if {[info exists TkGnats(SiteReadMeFile)]} {
    regsub -all " " $TkGnats(SiteReadMeTitle) "_" Title
    button .top.readme \
            -relief raised \
            -text "$TkGnats(SiteReadMeTitle)" \
            -command {show_help $Title "[file_get_text $TkGnats(SiteReadMeFile)]"}
    pack .top.readme -side top -fill x
}

if {[info exists TkGnats(TkGnatsDocFile)]} {
    regsub -all " " $TkGnats(TkGnatsDocTitle) "_" Title
    button .top.doc \
            -relief raised \
            -text "$TkGnats(TkGnatsDocTitle)" \
            -command {show_help $Title "[file_get_text $TkGnats(TkGnatsDocFile)]"}
    pack .top.doc -side top -fill x
}

if {[info exists TkGnats(InfoReader)]} {
    button .top.info \
            -relief raised \
            -text "GNATS Info" \
            -command "exec $TkGnats(InfoReader) &; schedule_reap"
    pack .top.info -side top -fill x
}

if {[info exists TkGnats(MailReader)]} {
    button .top.mail \
            -relief raised \
            -text "Mail System" \
            -command "exec $TkGnats(MailReader) &; schedule_reap"
    pack .top.mail -side top -fill x
}

pack [frame .top.space2] -side top -fill x -pady 5

pack .top.quit -side top -fill x

wm title      . "TkGnats - Main Menu"
wm iconbitmap . @$TkGnats(lib)/tkgnats.xbm
wm iconname   . "$TkGnats(LogName)'s tkgnats"
