#!/usr/bin/env wish
#
# HW6, GUI number multiplying program

. configure -width 200 -height 400

label .header -text "Number multiplying program"
place .header -x 5 -y 2

label .num1Text -text "1st number"
place .num1Text -x 20 -y 40
entry .slidbox -width 5 -textvariable num1
place .slidbox -x 110 -y 40

label .num2Text -text "2nd number"
place .num2Text -x 18 -y 80
entry .slidbox2 -width 5 -textvariable num2
place .slidbox2 -x 110 -y 80

button .ok -command {process_data $num1 $num2} -text "Multiply"
button .cancel -command {exit} -text "Exit" -background red
place .ok -x 15 -y 350
place .cancel -x 120 -y 350

proc process_data {num1 num2} {
  puts stdout "$num1 times $num2 is [expr $num1 * $num2]"
}

