summaryrefslogtreecommitdiffstats
path: root/library/bgerror.tcl
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2005-11-15 03:12:17 (GMT)
committerjenglish <jenglish@flightlab.com>2005-11-15 03:12:17 (GMT)
commit510452cedeeebfa59bfb1f13e86e74a6bc287320 (patch)
treec53247000d7b7dbc8f889c2d85fc32ff9b7967c5 /library/bgerror.tcl
parentf456d646b18f6f026225e22bfb88b8e19cc028c9 (diff)
downloadtk-510452cedeeebfa59bfb1f13e86e74a6bc287320.zip
tk-510452cedeeebfa59bfb1f13e86e74a6bc287320.tar.gz
tk-510452cedeeebfa59bfb1f13e86e74a6bc287320.tar.bz2
bgerror dialog: Truncate error messages at 45 characters
instead of 30 [#1224235].
Diffstat (limited to 'library/bgerror.tcl')
-rw-r--r--library/bgerror.tcl13
1 files changed, 7 insertions, 6 deletions
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index 8181cf2..a1837a2 100644
--- a/library/bgerror.tcl
+++ b/library/bgerror.tcl
@@ -9,8 +9,8 @@
# Copyright (c) 1998-2000 by Ajuba Solutions.
# All rights reserved.
#
-# RCS: @(#) $Id: bgerror.tcl,v 1.28 2005/08/09 07:39:19 das Exp $
-# $Id: bgerror.tcl,v 1.28 2005/08/09 07:39:19 das Exp $
+# RCS: @(#) $Id: bgerror.tcl,v 1.29 2005/11/15 03:12:18 jenglish Exp $
+# $Id: bgerror.tcl,v 1.29 2005/11/15 03:12:18 jenglish Exp $
namespace eval ::tk::dialog::error {
namespace import -force ::tk::msgcat::*
@@ -101,14 +101,15 @@ proc ::tk::dialog::error::bgerror err {
}
- # Truncate the message if it is too wide (longer than 30 characacters) or
- # too tall (more than 4 newlines). Truncation occurs at the first point at
+ # Truncate the message if it is too wide (>maxLine characters) or
+ # too tall (>4 lines). Truncation occurs at the first point at
# which one of those conditions is met.
set displayedErr ""
set lines 0
+ set maxLine 45
foreach line [split $err \n] {
- if { [string length $line] > 30 } {
- append displayedErr "[string range $line 0 29]..."
+ if { [string length $line] > $maxLine } {
+ append displayedErr "[string range $line 0 [expr {$maxLine-3}]]..."
break
}
if { $lines > 4 } {