summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-07-31 14:10:55 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-07-31 14:10:55 (GMT)
commit8dd5c32785f13f36633b81a30186b977d740bf8b (patch)
tree72e2f2fed5f6061a545aea89677902efe6f84bec /generic
parent5436e993cdf88474bf2f8c3a80a5b7dfcf3af3e1 (diff)
downloadtk-8dd5c32785f13f36633b81a30186b977d740bf8b.zip
tk-8dd5c32785f13f36633b81a30186b977d740bf8b.tar.gz
tk-8dd5c32785f13f36633b81a30186b977d740bf8b.tar.bz2
Postpone paned-window layout arrangement on geometry event until idle,
as is done in other window managers, to fix problems with size calculations when the children don't already know their sizes anyway. Now the layout of the vertical pane demo works better (overall initial window width is right!)
Diffstat (limited to 'generic')
-rw-r--r--generic/tkPanedWindow.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index be14e9c..3e9cd4d 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.4 2002/06/19 23:17:17 hobbs Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.5 2002/07/31 14:10:56 dkf Exp $
*/
#include "tkPort.h"
@@ -1501,7 +1501,10 @@ PanedWindowReqProc(clientData, tkwin)
{
Slave *panePtr = (Slave *) clientData;
PanedWindow *pwPtr = (PanedWindow *) (panePtr->masterPtr);
- ComputeGeometry(pwPtr);
+ if (!(pwPtr->flags & REQUESTED_RELAYOUT)) {
+ pwPtr->flags |= REQUESTED_RELAYOUT;
+ Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr);
+ }
}
/*
@@ -1810,7 +1813,7 @@ ComputeGeometry(pwPtr)
int i, x, y, doubleBw, internalBw;
int reqWidth, reqHeight, sashWidth, sxOff, syOff, hxOff, hyOff, dim;
Slave *slavePtr;
-
+
pwPtr->flags |= REQUESTED_RELAYOUT;
x = y = internalBw = Tk_InternalBorderWidth(pwPtr->tkwin);