summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--library/console.tcl18
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4015c6b..d238ebb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-03 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * library/console.tcl: Add menu item and key binding to adjust font
+
2007-11-02 Donal K. Fellows <dkf@users.sf.net>
* library/demos/mclist.tcl: Added a demo of how to do a multi-column
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