rx-tool/comselect.tcl
1: #!/usr/bin/wish
2: #
3: #
4:
5:
6: set PORTS "[glob /dev/ttyUSB* /dev/ttyS*] COM1 COM2 COM3 COM4 COM5 COM6 COM7 COM8 COM9"
7: set COMPORT [lindex $PORTS 0]
8:
9: frame .d
10: pack .d -side top -expand yes -fill both
11:
12: menubutton .d.port -text "Port: $COMPORT" -underline 0 -direction above -menu .d.port.m -relief raised
13: pack .d.port -side top -expand no -fill x
14:
15: menu .d.port.m -tearoff 0
16: foreach PORT $PORTS {
17: eval .d.port.m add command -label \"$PORT\" -command \{set COMPORT $PORT \; .d.port configure -text \"Port: \$COMPORT\"\}
18: }
19:
20: button .d.view -text "OK" -command {
21: puts "$COMPORT"
22: }
23: pack .d.view -side top -expand yes -fill both
24: