Posted to tcl by yeeling at Fri Jul 20 12:59:12 GMT 2007view raw

  1. proc fields {w contents} {
  2. frame $w
  3. set n 0
  4. foreach i $contents {
  5. if [string match $* $i] {
  6. ttk::entry $w.$n -textvariable [string range $i 1 end] -width 10
  7. } elseif [string match '$* $i] {
  8. ttk::label $w.$n -textvariable [string range $i 2 end] -wraplength 550
  9. } else {
  10. ttk::label $w.$n -text $i -wraplength 550
  11. }
  12. incr n
  13. }
  14. eval pack [winfo children $w] -side left -anchor w
  15. set w
  16. }