Posted to tcl by iobates at Tue Aug 04 14:14:34 GMT 2026view raw

  1. package require sqlite3
  2. package require Tk
  3.  
  4. cd ~/db/
  5. sqlite3 db test.db
  6.  
  7. wm title . "Diet"
  8. bind . <Control-q> {exit}
  9.  
  10.  
  11. grid [ttk::frame .f -padding "3 3 12 12"] -column 0 -row 0 -sticky nwes
  12. grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1
  13.  
  14. grid [ttk::entry .f.name -width 16 -textvariable name] -column 1 -row 1 -sticky we
  15. grid [ttk::label .f.namelbl -text "s"] -column 2 -row 1 -sticky w
  16.  
  17. grid [ttk::entry .f.dietid -width 16 -textvariable did] -column 1 -row 2 -sticky we
  18. grid [ttk::label .f.dietlbl -text "y"] -column 2 -row 2 -sticky w
  19.  
  20. grid [ttk::entry .f.checkin -width 16 -textvariable checkw] -column 1 -row 3 -sticky we
  21. grid [ttk::label .f.checklbl -text "h"] -column 2 -row 3 -sticky w
  22.  
  23.  
  24. grid [ttk::frame .f.weight -padding "0 0 0 0"] -column 1 -row 4 -sticky we
  25. grid [ttk::entry .f.weight.year -width 4 -textvariable cyear] -column 1 -row 1 -sticky we
  26. grid [ttk::label .f.weight.ylbl -text "Y"] -column 2 -row 1 -sticky w
  27. grid [ttk::entry .f.weight.month -width 2 -textvariable cmonth] -column 3 -row 1 -sticky we
  28. grid [ttk::label .f.weight.mlbl -text "M"] -column 4 -row 1 -sticky w
  29. grid [ttk::entry .f.weight.day -width 2 -textvariable cday] -column 5 -row 1 -sticky we
  30. grid [ttk::label .f.weight.dlbl -text "D"] -column 6 -row 1 -sticky w
  31. # grid [ttk::entry .f.checkinday -width 16 -textvariable checkin] -column 1 -row 4 -sticky we
  32. # grid [ttk::label .f.checkdaylbl -text "e"] -column 2 -row 4 -sticky w
  33.  
  34. grid [ttk::entry .f.goal -width 16 -textvariable goal] -column 1 -row 5 -sticky we
  35. grid [ttk::label .f.goallbl -text "G"] -column 2 -row 5 -sticky w
  36.  
  37. grid [ttk::entry .f.startw -width 16 -textvariable startw] -column 1 -row 6 -sticky we
  38. grid [ttk::label .f.swlbl -text "c"] -column 2 -row 6 -sticky w
  39.  
  40. grid [ttk::entry .f.startd -width 16 -textvariable startd] -column 1 -row 7 -sticky we
  41. grid [ttk::label .f.stdlbl -text "b"] -column 2 -row 7 -sticky w
  42.  
  43. grid [ttk::entry .f.endd -width 16 -textvariable endd] -column 1 -row 8 -sticky we
  44. grid [ttk::label .f.endlbl -text "a"] -column 2 -row 8 -sticky w
  45.  
  46. grid [ttk::button .f.search -width 10 -text "Search" -command search] -column 1 -row 9 -sticky we
  47. grid [ttk::button .f.commit -width 10 -text "Commit" -command commit] -column 2 -row 9 -sticky we
  48.  
  49.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week