#!/usr/bin/wish
package require wylib

#Ask logic builder for a dialog
#dia::dia .d9 -but {OK Cancel} -def 0 -dest ::v(ll)\
#  -entry loglst::loglst -left tto -func eq \
#    -o {eq	Equals		-h {The left and right values are exactly the same}}\
#    -o {cn	Contains	-h {The value on the right can be found somewhere inside the value on the left}}\
#    -f {tto To:		-h {The intended recipient of the email}}\
#    -f {tfr From:		-h {Who sent the email}}
#puts "loglst:[join $v(ll) "\n"]"

#Brief
dia::brief "You may get another chance" 5000 50
dia::err "But I doubt it"
dia::brief "You messed up"

#date
date::dia {What is the date:} -dest ::v(date)

#Complex entry widget
set v(comp) {fname Fred lname Johnson opt hi}
dia::dia .d4 -but {OK Cancel} -def 0 -message {What's your name:} -place p -par {}\
  -entry mdew::mdew -dest ::v(comp) -pre 1 -timeout 10000 \
    -f {fname	ent	10	{0 1}	{First name:} -bg lightgreen}\
    -f {lname	ent	16	{0 2}	{Last name:}  -bg lightblue}\
    -f {opt	pdm	4	{0 3}	{Option:} -textv ::v(option) -data {{hi {Hi There}} {you {That's you}}} -init you}
puts "name:$v(comp)"

#spinner
#dia::dia .d0 -f {spin::ent {A number:} -textv ::v(number) -width 4 -just r -spf clc}

set v(name) {Fred Garvin}
dia::query {Name:} ::v(name) 0 OK Cancel
puts "name:$v(name)"

#Password
puts "passwd:[dia::pquery]"

#Errors
dia::err "You messed up"
dia::ask "Now you really messed up" 0 {I know} Cancel

#Simple prompt
dia::ask "Ready to Continue 1?"
dia::ask "Ready to Continue 2?" 0 Yes Cancel
dia::dia .d1 -mess "Ready to Continue 3?"

#Multiple choice buttons
dia::dia .d2 -mess "Are you sure?" -button {Yes No Maybe Cancel} -defa 1

#Input a value
dia::query {What is your name:} ::v(name) 0 {OK Cancel}
puts "name:$v(name)"

exit
