From 54b6a0ea9bc14edda4300ad4cee66a870db7f87a Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 21 May 2015 17:06:04 +0100 Subject: Make default width configurable --- tkread | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tkread b/tkread index 0991dcc..96e5f03 100755 --- a/tkread +++ b/tkread @@ -34,6 +34,7 @@ set selectbgcolour #ffffff set inverttextcolour #eeeeee set invertbgcolour #333030 set invertoutercolour #222222 +set width 64 set inverted 0 set drag 0 @@ -362,9 +363,8 @@ proc scaleImages {} { global imgshrunk foreach img [.t image names] { - # note width is 64 * (width of '0' char) set charwidth [font measure "{$fontfamily} $fontsize" "0"] - set maxwidth [expr $charwidth * 64] + set maxwidth [expr $charwidth * $width] set curwidth [image width $img] if {$curwidth < $maxwidth} { if { $imgshrunk($img) == 1 } { @@ -411,7 +411,7 @@ if { [lsearch [font families] "$fontfamily"] == -1 } { set fontfamily Times } . configure -bg $outercolour -text .t -font "{$fontfamily} $fontsize" -wrap word -width 64 -padx [expr $fontsize * 3] -bg $bgcolour -fg $textcolour -relief flat -inactiveselectbackground $selectbgcolour +text .t -font "{$fontfamily} $fontsize" -wrap word -width $width -padx [expr $fontsize * 3] -bg $bgcolour -fg $textcolour -relief flat -inactiveselectbackground $selectbgcolour pack .t -expand yes -fill y set text [read stdin] foreach arg $::argv { -- cgit v1.2.3