From 510452cedeeebfa59bfb1f13e86e74a6bc287320 Mon Sep 17 00:00:00 2001 From: jenglish Date: Tue, 15 Nov 2005 03:12:17 +0000 Subject: bgerror dialog: Truncate error messages at 45 characters instead of 30 [#1224235]. --- ChangeLog | 4 ++++ library/bgerror.tcl | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2519cb4..b196ebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-11-14 Joe English + * library/bgerror.tcl: Truncate error messages at 45 characters + instead of 30 [#1224235]. + 2005-11-14 Donal K. Fellows * generic/tkSelect.c (TkSelDefaultSelection): Test select-9.5 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 } { -- cgit v0.12