diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2002-08-06 14:38:12 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2002-08-06 14:38:12 (GMT) |
commit | fbc0f851153deeb341f9fbcffd79acfc126fd66a (patch) | |
tree | def367a9609ed3ba097641c0aaba8c8b8d119b62 /generic | |
parent | 9baf18e9144d7f89115f073a2e6252d7e684cce5 (diff) | |
download | tk-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.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkPanedWindow.c | 23 |
1 files changed, 17 insertions, 6 deletions
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 |