Posted to tcl by jeremy_c at Thu Sep 13 18:42:07 GMT 2007view raw

  1. proc change_text {name text} {
  2. $name configure -text $text
  3. }
  4.  
  5. proc create_dropdown {name current options} {
  6. ttk::menubutton $name -width 15
  7. set tm [menu $name.menu]
  8. foreach opt_name $options {
  9. $tm add command -label $opt_name -command [list change_text $name $opt_name]
  10. }
  11. $name configure -menu $tm
  12. return $name
  13. }
  14.  
  15. proc create_type_combo {name current} {
  16. return [create_dropdown $name $current {All Procedure DME JCode Formulary}]
  17. }