summaryrefslogtreecommitdiffstats
path: root/library/ttk/fonts.tcl
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2006-11-03 15:35:39 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2006-11-03 15:35:39 (GMT)
commitb1d837cc1a4b0654ab78b3380989e5539c654bb5 (patch)
treea179bd0153fbb37fea48e2a0a4b41987a48419e2 /library/ttk/fonts.tcl
parent9904e2e3e00e1fe4826b913abaf597f20163d3cc (diff)
downloadtk-b1d837cc1a4b0654ab78b3380989e5539c654bb5.zip
tk-b1d837cc1a4b0654ab78b3380989e5539c654bb5.tar.gz
tk-b1d837cc1a4b0654ab78b3380989e5539c654bb5.tar.bz2
In a safe interp there is no osVersion field in tcl_platform so work around it.
Diffstat (limited to 'library/ttk/fonts.tcl')
-rw-r--r--library/ttk/fonts.tcl21
1 files changed, 15 insertions, 6 deletions
diff --git a/library/ttk/fonts.tcl b/library/ttk/fonts.tcl
index c3d4d50..cca7d25 100644
--- a/library/ttk/fonts.tcl
+++ b/library/ttk/fonts.tcl
@@ -1,5 +1,5 @@
#
-# $Id: fonts.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $
+# $Id: fonts.tcl,v 1.2 2006/11/03 15:35:40 patthoyts Exp $
#
# Ttk package: Font specifications.
#
@@ -83,11 +83,20 @@ catch {font create TkTooltipFont}
switch -- [tk windowingsystem] {
win32 {
- if {$tcl_platform(osVersion) >= 5.0} {
- variable family "Tahoma"
- } else {
- variable family "MS Sans Serif"
- }
+ # In safe interps there is no osVersion element.
+ if {[info exists tcl_platform(osVersion)]} {
+ if {$tcl_platform(osVersion) >= 5.0} {
+ variable family "Tahoma"
+ } else {
+ variable family "MS Sans Serif"
+ }
+ } else {
+ if {[lsearch -exact [font families] Tahoma] != -1} {
+ variable family "Tahoma"
+ } else {
+ variable family "MS Sans Serif"
+ }
+ }
variable size 8
font configure TkDefaultFont -family $family -size $size