Posted to tcl by mjanssen at Fri Dec 08 22:19:28 GMT 2006view raw

  1. package require Tk
  2.  
  3. # this widget is containing or normal text
  4. text .t
  5. pack .t
  6.  
  7. # this widget will contain the result, but is not visible yet
  8. text .r
  9. .t insert 1.0 test
  10.  
  11. proc display_result {} {
  12. pack forget .t
  13. pack .r
  14. .r delete 1.0 end
  15. .r insert 1.0 {this is the result}
  16. bind .r <KeyPress> {pack forget .r ; pack .t ; break}
  17. }
  18.  
  19. display_result