Posted to tcl by silas at Sat Nov 05 20:19:10 GMT 2022view raw

  1. package require Tk
  2. pack [frame .f]
  3. pack [label .f.l -text test]
  4. pack [entry .f.e]
  5. bind <FocusIn> .f {
  6. puts test
  7. focus .f.e
  8. }
  9. pack [button .btn -text {Focus entry, please!} -command {focus .f}]