Posted to tcl by de at Thu Nov 13 00:52:41 GMT 2008view raw

  1.  
  2. package require Tktable
  3.  
  4. set aeros_var(0,0) "Aeros"
  5. set aeros_var(0,1) "Identifier"
  6. set aeros_var(0,2) "Type"
  7. table .aeros_table -cols 3 -rows 1 -titlecols 1 -titlerows 1 \
  8. -variable aeros_var -yscrollcommand ".aeros_table_yscroll set"
  9. scrollbar .aeros_table_yscroll -command ".aeros_table yview"
  10. button .aeros_add_button -text "add" -command aeros_add
  11.  
  12. pack .aeros_table -side left -anchor n
  13. pack .aeros_table_yscroll -side left -fill y
  14. pack .aeros_add_button
  15.  
  16.  
  17. proc aeros_add {} \
  18. {
  19. global array aeros_var {}
  20.  
  21. set rows [.aeros_table cget -rows]
  22. .aeros_table configure -rows [expr 1 + $rows]
  23. set aeros_var($rows,0) $rows
  24. }
  25.