From: Joakim Storck Date: 2000-12-18T21:40:02+09:00 Subject: [ruby-talk:7566] Re: Popping up secondary Tk windows > I want to pop up a data entry window at the current cursor location, > to allow the user to enter a label to associate with an item on the > screen. This is an example in Tcl of you can create a transient modal dialog box. The ShowWindow procedure can create a toplevel that contains all the widgets you like. If you want the second window to appear at the current cursor location (on top of the invoking button?) I think it's best to take care of that in the ShowWindow procedure as well. # proc ShowWindow {w parent} { global ${w}isDone if {![winfo exists $w]} { toplevel $w button $w.b -text "Close" -command "set ${w}isDone 1" pack $w.b } wm deiconify $w wm transient $w $parent grab $w focus -force $w vwait ${w}isDone wm withdraw $w grab release $w return } toplevel .w button .w.b -text "Press me!" -command "ShowWindow .w2 .w" pack .w.b Sent via Deja.com http://www.deja.com/