summaryrefslogtreecommitdiffstats
path: root/library/console.tcl
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2008-05-13 13:25:17 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2008-05-13 13:25:17 (GMT)
commitd853863c8bbda281a220cea42a6e295b76ebc8ea (patch)
tree909f6370ac73eded508c90e28f613e44670e080d /library/console.tcl
parent5455d198e07230942a6c8a35927cbf2ac91afa0f (diff)
downloadtk-d853863c8bbda281a220cea42a6e295b76ebc8ea.zip
tk-d853863c8bbda281a220cea42a6e295b76ebc8ea.tar.gz
tk-d853863c8bbda281a220cea42a6e295b76ebc8ea.tar.bz2
Support pixel sized font in the +/- keybindings
Diffstat (limited to 'library/console.tcl')
-rw-r--r--library/console.tcl11
1 files changed, 8 insertions, 3 deletions
diff --git a/library/console.tcl b/library/console.tcl
index 6c176bc..cc38ca5 100644
--- a/library/console.tcl
+++ b/library/console.tcl
@@ -4,7 +4,7 @@
# can be used by non-unix systems that do not have built-in support
# for shells.
#
-# RCS: @(#) $Id: console.tcl,v 1.37 2007/12/13 15:26:27 dgp Exp $
+# RCS: @(#) $Id: console.tcl,v 1.38 2008/05/13 13:25:18 patthoyts Exp $
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
@@ -554,11 +554,16 @@ proc ::tk::ConsoleBind {w} {
}
bind Console <<Console_FontSizeIncr>> {
set size [font configure TkConsoleFont -size]
- font configure TkConsoleFont -size [incr size]
+ if {$size < 0} {set sign -1} else {set sign 1}
+ set size [expr {(abs($size) + 1) * $sign}]
+ font configure TkConsoleFont -size $size
}
bind Console <<Console_FontSizeDecr>> {
set size [font configure TkConsoleFont -size]
- font configure TkConsoleFont -size [incr size -1]
+ if {abs($size) < 2} { return }
+ if {$size < 0} {set sign -1} else {set sign 1}
+ set size [expr {(abs($size) - 1) * $sign}]
+ font configure TkConsoleFont -size $size
}
##