summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2015-05-21 17:06:04 +0100
committerNick White <git@njw.name>2015-05-21 17:06:04 +0100
commit54b6a0ea9bc14edda4300ad4cee66a870db7f87a (patch)
treeb3f48b48b5c37d9bcbe8df298705c4ed6791ee70
parent40a422fabd3fe14a83b6a0213fef821614f4c568 (diff)
downloadtkread-54b6a0ea9bc14edda4300ad4cee66a870db7f87a.tar.bz2
tkread-54b6a0ea9bc14edda4300ad4cee66a870db7f87a.zip
Make default width configurable
-rwxr-xr-xtkread6
1 files 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 {