[Richard Suchenwirth] 2003-04-02 - Here is a custom dialog that prompts for a value: proc value_dialog {string} { set w [toplevel .[clock seconds]] wm resizable $w 0 0 wm title $w "Value request" label $w.l -text $string entry $w.e -textvar $w -bg white bind $w.e {set done 1} button $w.ok -text OK -command {set done 1} button $w.c -text Clear -command {set result ""} button $w.cancel -text Cancel -command {set result ""; set done 1} grid $w.l - - -sticky news grid $w.e - - -sticky news grid $w.ok $w.c $w.cancel vwait done destroy $w set ::$w } #----- Test set test [value_dialog "Give me a value please:"] puts test:$test ---- [Arts and crafts of Tcl-Tk programming]