[EMAIL PROTECTED] wrote:
> 
> Hi,
> 
> I'm having a small problem with a bit of code.  I've made a procedure
> that creates a new toplevel window with a message in it each time a
> button is pressed.  I've used a counter variable that is incremented
> each time the button is pressed, and the number is appended at the end
> of the message name.  As an example, .nslookup$ctr  I'm also trying to
> add a button at the bottom of the window that will destroy the widget,
> but with the counter being incremented I can kill the last window I
> create, but not any of the other ones.  Can anyone help me figure out
> how to do this.  Any help would be greatly appreciated.
> 
> button .nslookup$ctr.b -text Dismiss -command { destroy .nslookup$ctr }
> pack .nslookup$ctr.msg -side top
> pack .nslookup$ctr.b -side bottom

Try this :

button .nslookup$ctr.b -text Dismiss -command { destroy [focus] }


-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to