Posted to tcl by jeremy_c at Thu Sep 13 23:21:34 GMT 2007view raw

  1. dbcombo instproc init args {
  2. global db
  3.  
  4. my set path [string trimleft [self] ":"]
  5. set path [my path]
  6. set sql [my sql]
  7. set idvariable [my idvariable]
  8.  
  9. ttk::menubutton [my path] -width [my width]
  10. menu $path.menu
  11. pg_select $db $sql result {
  12. $path.menu add command -label $result(label)
  13. }
  14. $path configure -menu $path.menu
  15.  
  16. upvar #0 $idvariable idvar
  17. trace add variable idvar write [list [my] showChange]
  18. }