summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-08-06 14:38:12 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-08-06 14:38:12 (GMT)
commitfbc0f851153deeb341f9fbcffd79acfc126fd66a (patch)
treedef367a9609ed3ba097641c0aaba8c8b8d119b62
parent9baf18e9144d7f89115f073a2e6252d7e684cce5 (diff)
downloadtk-fbc0f851153deeb341f9fbcffd79acfc126fd66a.zip
tk-fbc0f851153deeb341f9fbcffd79acfc126fd66a.tar.gz
tk-fbc0f851153deeb341f9fbcffd79acfc126fd66a.tar.bz2
Made panedwindow tests all work again; I'm fairly sure the current behaviour is still not right, but it is definitely better than it was when I first started tinkering with the panedwindow in that now it at least picks a sensible size in one dimension when working with widgets whose size is not known immediately.
-rw-r--r--ChangeLog9
-rw-r--r--generic/tkPanedWindow.c23
2 files changed, 26 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 482d759..79f65f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-08-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (RESIZE_PENDING): Separated out flag for
+ indicating that a resize needs to be issued.
+ (PanedWindowReqProc): Do the old behaviour when the panedwindow is
+ not mapped; easiest way of making the test suite pass while still
+ preserving improved behaviour in the face of children whose size
+ is not known immediately.
+
2002-08-06 Don Porter <dgp@users.sf.net>
* tests/defs.tcl: removed file. No longer needed now that Tk is
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index fa741a9..253a626 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.6 2002/08/02 15:35:53 dkf Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.7 2002/08/06 14:38:13 dkf Exp $
*/
#include "tkPort.h"
@@ -134,6 +134,11 @@ typedef struct PanedWindow {
*
* WIDGET_DELETED: Non-zero means that the paned window has
* been, or is in the process of being, deleted.
+ *
+ * RESIZE_PENDING: Non-zero means that the window might need to
+ * change its size (or the size of its panes)
+ * because of a change in the size of one of its
+ * children.
*/
#define REDRAW_PENDING 0x0001
@@ -141,6 +146,8 @@ typedef struct PanedWindow {
#define REQUESTED_RELAYOUT 0x0004
#define RECOMPUTE_GEOMETRY 0x0008
#define PROXY_REDRAW_PENDING 0x0010
+#define RESIZE_PENDING 0x0020
+
/*
* Forward declarations for procedures defined later in this file:
*/
@@ -1436,7 +1443,7 @@ DestroyPanedWindow(pwPtr)
if (pwPtr->flags & REDRAW_PENDING) {
Tcl_CancelIdleCall(DisplayPanedWindow, (ClientData) pwPtr);
}
- if (pwPtr->flags & REQUESTED_RELAYOUT) {
+ if (pwPtr->flags & RESIZE_PENDING) {
Tcl_CancelIdleCall(ArrangePanes, (ClientData) pwPtr);
}
@@ -1504,9 +1511,13 @@ PanedWindowReqProc(clientData, tkwin)
{
Slave *panePtr = (Slave *) clientData;
PanedWindow *pwPtr = (PanedWindow *) (panePtr->masterPtr);
- if (!(pwPtr->flags & REQUESTED_RELAYOUT)) {
- pwPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr);
+ if (Tk_IsMapped(pwPtr->tkwin)) {
+ if (!(pwPtr->flags & RESIZE_PENDING)) {
+ pwPtr->flags |= RESIZE_PENDING;
+ Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr);
+ }
+ } else {
+ ComputeGeometry(pwPtr);
}
}
@@ -1578,7 +1589,7 @@ ArrangePanes(clientData)
int i, slaveWidth, slaveHeight, slaveX, slaveY, paneWidth, paneHeight;
int doubleBw;
- pwPtr->flags &= ~REQUESTED_RELAYOUT;
+ pwPtr->flags &= ~(REQUESTED_RELAYOUT|RESIZE_PENDING);
/*
* If the parent has no slaves anymore, then don't do anything