Posted to tcl by oldlaptop at Sun Aug 29 04:21:20 GMT 2021view raw

  1. #!/usr/bin/env tclsh
  2.  
  3. package require Tk
  4.  
  5. proc entry_insert {entry_name value} {
  6. $entry_name configure -state normal
  7. $entry_name delete 0 end
  8. $entry_name insert end $value
  9. $entry_name configure -state readonly -readonlybackground white
  10. }
  11.  
  12. panedwindow .pw -orient horizontal
  13.  
  14. labelframe .pw.x1 -text Bapy
  15. label .pw.x1.l1 -text "L1" -justify left
  16. entry .pw.x1.e1 -width 48 -justify right
  17. entry_insert .pw.x1.e1 "AAAAAAAAAA"
  18.  
  19. # The marvelous wonders of RELATIVE PLACEMENT are not really
  20. # on display here because there's only one row, hmm...
  21. grid .pw.x1.l1 .pw.x1.e1 -sticky ew
  22. grid columnconfigure .pw.x1 1 -weight 1
  23.  
  24. labelframe .pw.x2 -text Mojo
  25. label .pw.x2.l1 -text "L2" -justify left
  26. entry .pw.x2.e1 -width 48 -justify right
  27. entry_insert .pw.x2.e1 "AAAAAAAAAA"
  28.  
  29. grid .pw.x2.l1 .pw.x2.e1 -sticky ew
  30. grid columnconfigure .pw.x2 1 -weight 1
  31.  
  32. .pw add .pw.x1
  33. .pw add .pw.x2
  34.  
  35. grid .pw -sticky nsew
  36. grid rowconfigure . 0 -weight 1
  37. grid columnconfigure . 0 -weight 1
  38.