summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-07-17 20:48:59 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-07-17 20:48:59 (GMT)
commit6eb4883088184b907621ae022deee1bc9f6bbb14 (patch)
tree0e812a896216448250395b18ea1fe325146f5beb
parent6975412d3b85ae353784b46da6204b629cd07b5d (diff)
downloadtk-6eb4883088184b907621ae022deee1bc9f6bbb14.zip
tk-6eb4883088184b907621ae022deee1bc9f6bbb14.tar.gz
tk-6eb4883088184b907621ae022deee1bc9f6bbb14.tar.bz2
Panedwindow fixes that make things behave right in complex geometry cases.
[Bugs 738143+747814]
-rw-r--r--ChangeLog7
-rw-r--r--doc/panedwindow.n8
-rw-r--r--generic/tkPanedWindow.c13
3 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d31bc2..d630555 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-07-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+ * generic/tkPanedWindow.c (PanedWindowReqProc): Fix from Eric
+ Boudaillier so panedwindows get their geometry right even when
+ their children don't know their size initially. [Bug 738143]
+ * doc/panedwindow.n: Removed sentences about the use of [update
+ idletasks] with this command, as that is no longer necessary with
+ the fix from Bug 738143. [Bug 747814]
+
* generic/tkImgPhoto.c (ImgPhotoCmd): Rewrote subcommand processing
to never jump to the end of the switch. I find that confusing as
I can't see whether there's processing still to be done from a
diff --git a/doc/panedwindow.n b/doc/panedwindow.n
index 5f2399c..20e43cf 100644
--- a/doc/panedwindow.n
+++ b/doc/panedwindow.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: panedwindow.n,v 1.2 2003/02/25 01:39:01 hobbs Exp $
+'\" RCS: @(#) $Id: panedwindow.n,v 1.2.2.1 2003/07/17 20:49:00 dkf Exp $
'\"
.so man.macros
.TH panedwindow n 8.4 Tk "Tk Built-In Commands"
@@ -83,11 +83,7 @@ Add one or more windows to the panedwindow, each in a separate pane.
The arguments consist of the names of one or more windows
followed by pairs of arguments that specify how to manage the windows.
\fIOption\fR may have any of the values accepted by the
-\fBconfigure\fR subcommand. When adding a new window that has not yet
-been mapped, and \fBupdate idletasks\fR call is required for that window
-to report its default requested geometry correctly to the panedwindow
-widget. This is not necessary if you are specifying \fI\-width\fR and
-\fI\-height\fR.
+\fBconfigure\fR subcommand.
.TP
\fIpathName \fBcget \fIoption\fR
Returns the current value of the configuration option given by
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index 60b938a..9763487 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.1 2003/07/17 00:37:03 hobbs Exp $
+ * RCS: @(#) $Id: tkPanedWindow.c,v 1.13.2.2 2003/07/17 20:49:00 dkf Exp $
*/
#include "tkPort.h"
@@ -1518,14 +1518,21 @@ PanedWindowReqProc(clientData, tkwin)
Tk_Window tkwin; /* Other Tk-related information
* about the window. */
{
- Slave *panePtr = (Slave *) clientData;
- PanedWindow *pwPtr = (PanedWindow *) (panePtr->masterPtr);
+ Slave *slavePtr = (Slave *) clientData;
+ PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr);
if (Tk_IsMapped(pwPtr->tkwin)) {
if (!(pwPtr->flags & RESIZE_PENDING)) {
pwPtr->flags |= RESIZE_PENDING;
Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr);
}
} else {
+ int doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width;
+ if (slavePtr->width <= 0) {
+ slavePtr->paneWidth = Tk_ReqWidth(slavePtr->tkwin) + doubleBw;
+ }
+ if (slavePtr->height <= 0) {
+ slavePtr->paneHeight = Tk_ReqHeight(slavePtr->tkwin) + doubleBw;
+ }
ComputeGeometry(pwPtr);
}
}