summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2007-11-03 00:51:22 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2007-11-03 00:51:22 (GMT)
commita6ff0f28e26dc7f61621709c254522ed63d75760 (patch)
tree3537aba5bca2a89efeacdb0b95e5dc3aafd5adc3 /library
parentef7dfda7bb60e3f9b25c2a0f638893615b28918d (diff)
downloadtk-a6ff0f28e26dc7f61621709c254522ed63d75760.zip
tk-a6ff0f28e26dc7f61621709c254522ed63d75760.tar.gz
tk-a6ff0f28e26dc7f61621709c254522ed63d75760.tar.bz2
Add menu item and key binding to adjust font
Diffstat (limited to 'library')
-rw-r--r--library/console.tcl18
1 files changed, 17 insertions, 1 deletions
diff --git a/library/console.tcl b/library/console.tcl
index 3951c5a..50cc810 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.33 2007/10/20 09:02:40 patthoyts Exp $
+# RCS: @(#) $Id: console.tcl,v 1.34 2007/11/03 00:51:23 patthoyts Exp $
#
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
# Copyright (c) 1998-2000 Ajuba Solutions.
@@ -96,6 +96,12 @@ proc ::tk::ConsoleInit {} {
-command tk::ConsoleAbout
}
+ AmpMenuArgs .menubar.edit add separator
+ AmpMenuArgs .menubar.edit add command -label [mc "&Increase font"] \
+ -command {event generate .console <<Console_FontSizeIncr>>}
+ AmpMenuArgs .menubar.edit add command -label [mc "&Reduce font"] \
+ -command {event generate .console <<Console_FontSizeDecr>>}
+
. configure -menu .menubar
# See if we can find a better font than the TkFixedFont
@@ -375,6 +381,8 @@ proc ::tk::ConsoleBind {w} {
<<Console_Transpose>> <Control-Key-t>
<<Console_ClearLine>> <Control-Key-u>
<<Console_SaveCommand>> <Control-Key-z>
+ <<Console_FontSizeIncr>> <Control-Key-plus>
+ <<Console_FontSizeDecr>> <Control-Key-minus>
} {
event add $ev $key
bind Console $key {}
@@ -535,6 +543,14 @@ proc ::tk::ConsoleBind {w} {
}
}
}
+ bind Console <<Console_FontSizeIncr>> {
+ set size [font configure TkConsoleFont -size]
+ font configure TkConsoleFont -size [incr size]
+ }
+ bind Console <<Console_FontSizeDecr>> {
+ set size [font configure TkConsoleFont -size]
+ font configure TkConsoleFont -size [incr size -1]
+ }
##
## Bindings for doing special things based on certain keys