#!/usr/bin/wish # matt willis - simple tk interface to fmtools # -*- tcl -*- # These are stations in the Toronto area. Customize for your own locale. set stations \ "CBC-1 99.1 CBC-2 94.1 CHFI 98.1 MIX 99.9 EDGE 102.1 CHUM 104.5 Q107 107.1 " set volume 32768 set n [expr [llength $stations]/2] set radbut 0 # make tuner buttons frame .labels for {set i 0} {$i<$n} {incr i 1} { radiobutton .r$i -value $i -variable radbut \ -text [lindex $stations [expr $i *2]] -command setstation pack .r$i -anchor w -in .labels } frame .rhs scale .vol -orient horizontal -from 0 -to 65535 -showvalue 0 \ -variable volume -label Volume: entry .stn -bg black -fg yellow -font "-*-helvetica-*-r-*-*-60-*-*-*-*-*-*-*" \ -width 6 -justify right -state disabled button .exit -command exit -text exit pack .vol .stn .exit -in .rhs pack .labels .rhs -side left .vol configure -command setvolume proc setstation {} { global stations radbut volume eval exec fm [lindex $stations [expr $radbut*2+1]] $volume .stn configure -state normal .stn delete 0 end .stn insert 0 [lindex $stations [expr $radbut*2+1]] .stn configure -state disabled } proc setvolume {sliderval} { setstation }