From a6ff0f28e26dc7f61621709c254522ed63d75760 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sat, 3 Nov 2007 00:51:22 +0000 Subject: Add menu item and key binding to adjust font --- ChangeLog | 4 ++++ library/console.tcl | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4015c6b..d238ebb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-11-03 Pat Thoyts + + * library/console.tcl: Add menu item and key binding to adjust font + 2007-11-02 Donal K. Fellows * 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 <>} + AmpMenuArgs .menubar.edit add command -label [mc "&Reduce font"] \ + -command {event generate .console <>} + . configure -menu .menubar # See if we can find a better font than the TkFixedFont @@ -375,6 +381,8 @@ proc ::tk::ConsoleBind {w} { <> <> <> + <> + <> } { event add $ev $key bind Console $key {} @@ -535,6 +543,14 @@ proc ::tk::ConsoleBind {w} { } } } + bind Console <> { + set size [font configure TkConsoleFont -size] + font configure TkConsoleFont -size [incr size] + } + bind Console <> { + set size [font configure TkConsoleFont -size] + font configure TkConsoleFont -size [incr size -1] + } ## ## Bindings for doing special things based on certain keys -- cgit v0.12