summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2003-02-20 21:08:29 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2003-02-20 21:08:29 (GMT)
commit88270da888bd830f92d6e4210abe7bdd03eeac8c (patch)
tree576ae3eebae88ffe3f352d0c0c98ce9a9eea6af7
parent3bd078b4e41cc6c97c8b54236f061fb9631b2e1c (diff)
downloadtk-88270da888bd830f92d6e4210abe7bdd03eeac8c.zip
tk-88270da888bd830f92d6e4210abe7bdd03eeac8c.tar.gz
tk-88270da888bd830f92d6e4210abe7bdd03eeac8c.tar.bz2
Fixed calculation of the last slave's
size when increasing the size of the panedwindow. [Bug #689099]
-rw-r--r--ChangeLog6
-rw-r--r--generic/tkPanedWindow.c8
-rw-r--r--tests/panedwindow.test49
3 files changed, 57 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ece0897..60e9b48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-02-20 Peter Spjuth <peter.spjuth@space.se>
+
+ * tests/panedwindow.test:
+ * generic/tkPanedWindow.c: Fixed calculation of the last slave's
+ size when increasing the size of the panedwindow. [Bug #689099]
+
2003-02-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
* generic/tkImgGIF.c (GetDataBlock): Removed pointless static
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index efc4793..a28f7e8 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkPanedWindow.c,v 1.10 2002/10/08 19:57:48 hobbs Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.11 2003/02/20 21:08:30 pspjuth Exp $
*/
#include "tkPort.h"
@@ -1635,8 +1635,7 @@ ArrangePanes(clientData)
if (i == pwPtr->numSlaves - 1 && Tk_IsMapped(pwPtr->tkwin)) {
if (Tk_Width(pwPtr->tkwin) > Tk_ReqWidth(pwPtr->tkwin)) {
paneWidth += Tk_Width(pwPtr->tkwin) -
- Tk_ReqWidth(pwPtr->tkwin) -
- Tk_InternalBorderWidth(pwPtr->tkwin);
+ Tk_ReqWidth(pwPtr->tkwin);
}
}
paneHeight = Tk_Height(pwPtr->tkwin) - (2 * slavePtr->pady) -
@@ -1646,8 +1645,7 @@ ArrangePanes(clientData)
if (i == pwPtr->numSlaves - 1 && Tk_IsMapped(pwPtr->tkwin)) {
if (Tk_Height(pwPtr->tkwin) > Tk_ReqHeight(pwPtr->tkwin)) {
paneHeight += Tk_Height(pwPtr->tkwin) -
- Tk_ReqHeight(pwPtr->tkwin) -
- Tk_InternalBorderWidth(pwPtr->tkwin);
+ Tk_ReqHeight(pwPtr->tkwin);
}
}
paneWidth = Tk_Width(pwPtr->tkwin) - (2 * slavePtr->padx) -
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index d1db959..2d77ed6 100644
--- a/tests/panedwindow.test
+++ b/tests/panedwindow.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: panedwindow.test,v 1.5 2002/09/30 18:55:57 hobbs Exp $
+# RCS: @(#) $Id: panedwindow.test,v 1.6 2003/02/20 21:08:30 pspjuth Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -2396,6 +2396,53 @@ test panedwindow-28.2 {destroy the window cleanly on rename [Bug #616589]} {
winfo exists .p
} {0}
+
+test panedwindow-29.1 {resizing width} {
+ -body {
+ panedwindow .p -bd 5
+ frame .f1 -width 100 -height 50 -bg blue
+ frame .f2 -width 100 -height 50 -bg red
+
+ .p add .f1 -sticky news
+ .p add .f2 -sticky news
+ pack .p -side top -fill both -expand 1
+ wm geometry . ""
+ update
+ # Note the width
+ set a [winfo width .f2]
+ # Increase the size by 10
+ regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
+ wm geometry . [expr {$w + 10}]x$h
+ update
+ set b "$a [winfo width .f2]"
+ }
+ -cleanup {destroy .p .f1 .f2}
+ -result {100 110}
+}
+
+test panedwindow-29.2 {resizing height} {
+ -body {
+ panedwindow .p -orient vertical -bd 5
+ frame .f1 -width 50 -height 100 -bg blue
+ frame .f2 -width 50 -height 100 -bg red
+
+ .p add .f1 -sticky news
+ .p add .f2 -sticky news
+ pack .p -side top -fill both -expand 1
+ wm geometry . ""
+ update
+ # Note the height
+ set a [winfo height .f2]
+ # Increase the size by 10
+ regexp {^(\d+)x(\d+)} [wm geometry .] -> w h
+ wm geometry . ${w}x[expr {$h + 10}]
+ update
+ set b "$a [winfo height .f2]"
+ }
+ -cleanup {destroy .p .f1 .f2}
+ -result {100 110}
+}
+
# cleanup
::tcltest::cleanupTests
return