Posted to tcl by Bradipo at Thu Jul 25 16:30:04 GMT 2024view raw

  1. proc handle {w} {
  2. $w delete 1.0 end
  3. }
  4. proc view {w} {
  5. puts stderr [binary encode hex [$w get 1.0 end]]
  6. }
  7. frame .f
  8. text .f.t -setgrid 1 -width 80 -height 3 -wrap word
  9. pack .f -expand 1 -fill both
  10. pack .f.t -expand 1 -fill both
  11. bind .f.t <Return> [list handle .f.t]
  12. bind .f.t <Control-Return> [list handle .f.t]
  13. bind .f.t <Control-x> [list handle .f.t]
  14. bind .f.t <Key-x> [list handle .f.t]
  15. bind .f.t <KeyRelease> [list view .f.t]
  16. focus .f.t
  17.