diff options
author | patthoyts <patthoyts@noemail.net> | 2006-11-03 15:35:38 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@noemail.net> | 2006-11-03 15:35:38 (GMT) |
commit | fa0f3c2b370442b15a1a651a3bcf5d6d6a54b91d (patch) | |
tree | a179bd0153fbb37fea48e2a0a4b41987a48419e2 | |
parent | 3b3333570da1416a1289ecb62dcaf14a4761ff82 (diff) | |
download | tk-fa0f3c2b370442b15a1a651a3bcf5d6d6a54b91d.zip tk-fa0f3c2b370442b15a1a651a3bcf5d6d6a54b91d.tar.gz tk-fa0f3c2b370442b15a1a651a3bcf5d6d6a54b91d.tar.bz2 |
In a safe interp there is no osVersion field in tcl_platform so work around it.
FossilOrigin-Name: 26e06743597ae14867d52fe218276248ef0de31b
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | library/ttk/fonts.tcl | 21 |
2 files changed, 20 insertions, 6 deletions
@@ -1,3 +1,8 @@ +2006-11-03 Pat Thoyts <patthoyts@users.sourceforge.net> + + * library/ttk/fonts.tcl: In a safe interp there is no osVersion + field in tcl_platform so work around it. + 2006-11-02 Daniel Steffen <das@users.sourceforge.net> * generic/ttk/ttkBlink.c, generic/ttk/ttkButton.c: 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 |