summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--library/bgerror.tcl18
2 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 3a7a9f5..69c1336 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-04 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/bgerror.tcl (bgerror): Stopped the bgerror dialog from
+ getting wider than the screen; in theory really long messages
+ could make it become taller than the screen now, but that's much
+ less likely to happen. Also trimmed a little bit of internal
+ space so that the icon-message gap is the same as the icon-frame
+ and message-frame gaps.
+
2002-07-01 Don Porter <dgp@users.sf.net>
* unix/configure:
diff --git a/library/bgerror.tcl b/library/bgerror.tcl
index d9770ae..b53f37b 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.21 2002/06/09 09:07:14 mdejong Exp $
-# $Id: bgerror.tcl,v 1.21 2002/06/09 09:07:14 mdejong Exp $
+# RCS: @(#) $Id: bgerror.tcl,v 1.22 2002/07/04 09:25:45 dkf Exp $
+# $Id: bgerror.tcl,v 1.22 2002/07/04 09:25:45 dkf Exp $
namespace eval ::tk {
namespace eval dialog {
@@ -174,7 +174,13 @@ proc ::tk::dialog::error::bgerror err {
# 2. Fill the top part with bitmap and message
- label .bgerrorDialog.msg -justify left -text $text -font $messageFont
+ # Max-width of message is the width of the screen...
+ set wrapwidth [winfo screenwidth .bgerrorDialog]
+ # ...minus the width of the icon, padding and a fudge factor for
+ # the window manager decorations and aesthetics.
+ set wrapwidth [expr {$wrapwidth-60-[winfo pixels .bgerrorDialog 9m]}]
+ label .bgerrorDialog.msg -justify left -text $text -font $messageFont \
+ -wraplength $wrapwidth
if { $tcl_platform(platform) eq "macintosh" } {
# On the Macintosh, use the stop bitmap
label .bgerrorDialog.bitmap -bitmap stop
@@ -190,9 +196,9 @@ proc ::tk::dialog::error::bgerror err {
-row 0 \
-padx 3m \
-pady 3m
- grid configure .bgerrorDialog.msg -sticky nsw
- grid rowconfigure .bgerrorDialog.top 1 -weight 1
- grid columnconfigure .bgerrorDialog.top 1 -weight 1
+ grid configure .bgerrorDialog.msg -sticky nsw -padx {0 3m}
+ grid rowconfigure .bgerrorDialog.top 1 -weight 1
+ grid columnconfigure .bgerrorDialog.top 1 -weight 1
# 3. Create a row of buttons at the bottom of the dialog.