summaryrefslogtreecommitdiffstats
path: root/library/demos/widget
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2007-05-04 21:29:22 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2007-05-04 21:29:22 (GMT)
commitb721e1f32dc43b3626d65e9211ae661af0d969f3 (patch)
tree51e7b83d5b0e0635d7c5c5de62858ea248f463ec /library/demos/widget
parent8d83285f461dd84680e46ac7ff6325f43cf48a74 (diff)
downloadtk-b721e1f32dc43b3626d65e9211ae661af0d969f3.zip
tk-b721e1f32dc43b3626d65e9211ae661af0d969f3.tar.gz
tk-b721e1f32dc43b3626d65e9211ae661af0d969f3.tar.bz2
TIP #145 implementation
Diffstat (limited to 'library/demos/widget')
-rw-r--r--library/demos/widget28
1 files changed, 21 insertions, 7 deletions
diff --git a/library/demos/widget b/library/demos/widget
index ec964f9..c4e9fd6 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -11,7 +11,7 @@ exec wish "$0" "$@"
# ".tcl" files is this directory, which are sourced by this script
# as needed.
#
-# RCS: @(#) $Id: widget,v 1.28 2006/09/11 14:41:04 das Exp $
+# RCS: @(#) $Id: widget,v 1.29 2007/05/04 21:29:22 patthoyts Exp $
package require Tcl 8.5
package require Tk 8.5
@@ -33,12 +33,26 @@ if {[tk windowingsystem] eq "x11"} {
}
if {[lsearch -exact [font names] defaultFont] == -1} {
- font create mainFont -family Helvetica -size 12
- font create fixedFont -family Courier -size 10
- font create boldFont -family Helvetica -size 12 -weight bold
- font create titleFont -family Helvetica -size 18 -weight bold
- font create statusFont -family Helvetica -size 10
- font create varsFont -family Helvetica -size 14
+ # TIP #145 defines some standard named fonts
+ if {[lsearch -exact [font names] TkDefaultFont] != -1} {
+ # FIX ME: the following tecnique of cloning the font to copy it works
+ # fine but means that if the system font is changed by
+ # Tk cannot update the copied font. font alias might be
+ # useful here -- or fix the app to use TkDefaultFont etc.
+ font create mainFont {*}[font configure TkDefaultFont]
+ font create fixedFont {*}[font configure TkFixedFont]
+ font create boldFont {*}[font configure TkDefaultFont] -weight bold
+ font create titleFont {*}[font configure TkDefaultFont] -weight bold
+ font create statusFont {*}[font configure TkDefaultFont]
+ font create varsFont {*}[font configure TkDefaultFont]
+ } else {
+ font create mainFont -family Helvetica -size 12
+ font create fixedFont -family Courier -size 10
+ font create boldFont -family Helvetica -size 12 -weight bold
+ font create titleFont -family Helvetica -size 18 -weight bold
+ font create statusFont -family Helvetica -size 10
+ font create varsFont -family Helvetica -size 14
+ }
}
set widgetDemo 1