summaryrefslogtreecommitdiffstats
path: root/library/bgerror.tcl
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-07-04 09:25:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-07-04 09:25:44 (GMT)
commitdfe0ebaa23104892c4b7658767d07bbf15de4e22 (patch)
treee7742e23d81bb1a87f7139cc788b2054e895e818 /library/bgerror.tcl
parentb47c1158e18dad5cf695845a95254bc2bc3204b9 (diff)
downloadtk-dfe0ebaa23104892c4b7658767d07bbf15de4e22.zip
tk-dfe0ebaa23104892c4b7658767d07bbf15de4e22.tar.gz
tk-dfe0ebaa23104892c4b7658767d07bbf15de4e22.tar.bz2
Improvements to bgerror dialog layout. [Bug #577086]
Diffstat (limited to 'library/bgerror.tcl')
-rw-r--r--library/bgerror.tcl18
1 files changed, 12 insertions, 6 deletions
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.