[Richard Suchenwirth] 2003-04-02 - Here is a custom dialog - a toplevel that prompts for a value: [http://mini.net/files/valuedialog.jpg] ---- 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 ---- [MSW]: I wouldn't specify the entry's background, for a real reusable dialog, I'd check the option database to see if something exists. Imho such little snippets should use a global option hierarchy so you can easily integrate them into application which use the option database themselves. Aside of that, nice... ---- [Arts and crafts of Tcl-Tk programming]