summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-05-03 19:17:39 (GMT)
committerhobbs <hobbs>2004-05-03 19:17:39 (GMT)
commit130b24b09df7ef93ac50cd3416153ea526598903 (patch)
treed4118a3c330618f886443d5ae8ef3f24bbc7cb45
parent823b7580b6622f742ca2dc4d42ff0c42dbc7729a (diff)
downloadtk-130b24b09df7ef93ac50cd3416153ea526598903.zip
tk-130b24b09df7ef93ac50cd3416153ea526598903.tar.gz
tk-130b24b09df7ef93ac50cd3416153ea526598903.tar.bz2
* tests/panedwindow.test: panedwindow-25.1
* generic/tkPanedWindow.c (Unlink): clean up -before/-after refs to a slave when removing it. [Bug #928413] (griffin)
-rw-r--r--ChangeLog16
-rw-r--r--generic/tkPanedWindow.c14
-rw-r--r--tests/panedwindow.test33
3 files changed, 49 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 78e9efb..4d4aa12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2004-05-03 Jeff Hobbs <jeffh@ActiveState.com>
+ * tests/panedwindow.test: panedwindow-25.1
+ * generic/tkPanedWindow.c (Unlink): clean up -before/-after refs
+ to a slave when removing it. [Bug #928413] (griffin)
+
* generic/tkImgPhoto.c (ImgPhotoConfigureMaster): force -data into
ByteArray and -format into String to correctly handle them if they
have been shimmered or created as some other object type.
@@ -40,7 +44,7 @@
(XMoveWindow): Generate configure notify events for child
widgets on move.
(XMoveResizeWindow): Ditto.
-
+
2004-03-17 Jim Ingham <jingham@apple.com>
* macosx/tkMacOSXHLEvents.c (ApplicationCarbonEventsHandler): New
@@ -54,14 +58,14 @@
Hide command to work, and the Apple HIG explicitly reserves them.
* macosx/tkMacOSXMenus.c (TkMacOSXInitMenus): Stop putting a Quit
menu item in the File menu. It doesn't belong there.
-
-2004-03-01 Don Porter <dgp@users.sourceforge.net>
+
+2004-03-01 Don Porter <dgp@users.sourceforge.net>
*** 8.4.6 TAGGED FOR RELEASE ***
- * unix/tcl.m4 (SC_CONFIG_CFLAGS): Allow 64-bit enabling on
- IRIX64-6.5* systems. [Bug 218561]
- * unix/configure: autoconf-2.13
+ * unix/tcl.m4 (SC_CONFIG_CFLAGS): Allow 64-bit enabling on
+ IRIX64-6.5* systems. [Bug 218561]
+ * unix/configure: autoconf-2.13
2004-02-23 Daniel Steffen <das@users.sourceforge.net>
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 07000c3..6151dbf 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.13.2.4 2003/08/19 21:00:13 jenglish Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.13.2.5 2004/05/03 19:17:39 hobbs Exp $
*/
#include "tkPort.h"
@@ -1748,6 +1748,18 @@ Unlink(slavePtr)
}
}
+ /*
+ * Clean out any -after or -before references to this slave
+ */
+ for (i = 0; i < masterPtr->numSlaves; i++) {
+ if (masterPtr->slaves[i]->before == slavePtr->tkwin) {
+ masterPtr->slaves[i]->before = None;
+ }
+ if (masterPtr->slaves[i]->after == slavePtr->tkwin) {
+ masterPtr->slaves[i]->after = None;
+ }
+ }
+
masterPtr->flags |= REQUESTED_RELAYOUT;
if (!(masterPtr->flags & REDRAW_PENDING)) {
masterPtr->flags |= REDRAW_PENDING;
diff --git a/tests/panedwindow.test b/tests/panedwindow.test
index f2af591..e4347c0 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.8.2.2 2003/07/18 09:53:16 dkf Exp $
+# RCS: @(#) $Id: panedwindow.test,v 1.8.2.3 2004/05/03 19:17:39 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -2138,7 +2138,7 @@ test panedwindow-24.22 {ConfigurePanes, slave specified multiple times} {
destroy .p .a .b .c
set result
} {.a .b .c}
-test panedwindow-22.23 {ConfigurePanes, slave specified multiple times} {
+test panedwindow-24.23 {ConfigurePanes, slave specified multiple times} {
# This test should not cause a core dump
panedwindow .p
@@ -2152,14 +2152,14 @@ test panedwindow-22.23 {ConfigurePanes, slave specified multiple times} {
destroy .p .a .b .c
set result
} {.c .a .b}
-test panedwindow-22.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
+test panedwindow-24.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
panedwindow .p
toplevel .t
set result [list [catch {.p add .t} msg] $msg]
destroy .p .t
set result
} [list 1 "can't add toplevel .t to .p"]
-test panedwindow-22.25 {ConfigurePanes, restrict possible panes} {
+test panedwindow-24.25 {ConfigurePanes, restrict possible panes} {
panedwindow .p
frame .f
button .f.b
@@ -2167,7 +2167,7 @@ test panedwindow-22.25 {ConfigurePanes, restrict possible panes} {
destroy .p .f .f.b
set result
} [list 1 "can't add .f.b to .p"]
-test panedwindow-22.26 {ConfigurePanes, restrict possible panes} {
+test panedwindow-24.26 {ConfigurePanes, restrict possible panes} {
frame .f
panedwindow .f.p
button .b
@@ -2175,14 +2175,14 @@ test panedwindow-22.26 {ConfigurePanes, restrict possible panes} {
destroy .f.p .f .b
set result
} [list 0 ""]
-test panedwindow-22.27 {ConfigurePanes, restrict possible panes} {
+test panedwindow-24.27 {ConfigurePanes, restrict possible panes} {
panedwindow .p
button .p.b
set result [list [catch {.p add .p.b} msg] $msg]
destroy .p .p.b
set result
} [list 0 ""]
-test panedwindow-22.28 {ConfigurePanes, restrict possible panes} {
+test panedwindow-24.28 {ConfigurePanes, restrict possible panes} {
frame .f
frame .f.f
frame .f.f.f
@@ -2193,6 +2193,25 @@ test panedwindow-22.28 {ConfigurePanes, restrict possible panes} {
set result
} [list 0 ""]
+test panedwindow-25.1 {Unlink, remove a paned with -before/-after refs} {
+ # Bug 928413
+ set result {}
+ panedwindow .pw
+ label .pw.l1 -text Label1
+ label .pw.l2 -text Label2
+ label .pw.l3 -text Label3
+ .pw add .pw.l1
+ .pw add .pw.l3
+ .pw add .pw.l2 -before .pw.l3
+ lappend result [.pw panecget .pw.l2 -before]
+ destroy .pw.l3
+ lappend result [.pw panecget .pw.l2 -before]
+ .pw paneconfigure .pw.l2 -before .pw.l1
+ lappend result [.pw panecget .pw.l2 -before]
+ destroy .pw
+ set result
+} {.pw.l3 {} .pw.l1}
+
test panedwindow-26.1 {DestroyPanedWindow} {
# This test should not result in any memory leaks.
panedwindow .p