#!/bin/bash
# the next line restarts using wish \
exec wish "$0" "$@"

proc positionWindow w {
  wm geometry $w +100+100
}

proc start_tk {prog} {
  set geom [split [wm geometry .] +]
  set geom "+[lindex $geom 1]+[lindex $geom 2]"
  destroy .
  exec $prog -geometry $geom &
}


proc start_menu {} {
    positionWindow .
    wm title . "DOSEMU Configuration" 
    set comptx "Compile configuration / compilation"

    label .run -text "
Select type of configuration

First you need to do '$comptx'
if you didn't yet compile this version of DOSEMU.
"
    pack .run -side top -padx 10

    button .compiletime -text $comptx \
	-command { start_tk ./compiletime_setup.tk }
    pack .compiletime -fill x -padx 10

    button .runtime -text "Runtime configuration" \
	-command { start_tk ./runtime_setup.tk }
    pack .runtime -fill x -padx 10

    button .cancel -text "Cancel" \
	-command { exit }
    pack .cancel -fill x -padx 10
    update idletasks
}

start_menu


