Figure: Check-, und Radiobuttons
#!/usr/bin/wish -f
#-----------------------------------------------------------#
#
# Programmname : crbuttons.tk
# TK-Version 4.0 TCL-Version 7.4
# Erstellungsatum: Mon Sep 9 12:09:37 GMT 1996
#
#-----------------------------------------------------------#
set FONT times
set WEIGHT 0
set SLANT 0
frame .fc -bd 5m
frame .fr -bd 5m
checkbutton .fc.fett -anchor w -text "fett" -variable WEIGHT \
-command setFont
checkbutton .fc.kursiv -anchor w -text "kursiv" -variable SLANT \
-command setFont
radiobutton .fr.times -anchor w -text "times" -variable FONT \
-command setFont -value times
radiobutton .fr.courier -anchor w -text "courier" -variable FONT \
-command setFont -value courier
radiobutton .fr.helvetica -anchor w -text "charter" -variable FONT \
-command setFont -value charter
button .b -text "Quit" -command exit \
-font "-*-times-medium-r-*--16-*-*-*-*-*-*-*"
pack .b -side bottom -fill x
pack .fc .fr -side left -fill both -expand 1
pack .fc.fett .fc.kursiv -fill x
pack .fr.times .fr.courier .fr.helvetica -fill x
#==========================================================#
# Prozedur zum aendern des Fonts
#----------------------------------------------------------#
proc setFont {} {
global FONT
global WEIGHT
global SLANT
if {$WEIGHT == 1} {
set weight "bold"
} else {
set weight "medium"
}
if {$SLANT == 1} {
set slant "i"
} else {
set slant "r"
}
.b configure -font [list -*-$FONT-$weight-$slant-*--16-*-*-*-*-*-*-*]
}