You can put any valid sequence of Tcl commands as the parameter for the -command option of a button. So, if I understand your question correctly, you might do something like:
button .b -text <whatever> -command {
toplevel .newWindow
pack [entry .newWindow.e -textvariable bt] -side top
set bt <whatever you want>
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.