diff options
-rw-r--r-- | generic/tkPanedWindow.c | 21 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 2 | ||||
-rw-r--r-- | win/tkWinWm.c | 2 |
3 files changed, 22 insertions, 3 deletions
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 85ab8b0..0e1bc53 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -680,6 +680,15 @@ PanedWindowWidgetObjCmd( if (objc <= 4) { tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), pwPtr->tkwin); + if (tkwin == NULL) { + /* + * Just a plain old bad window; Tk_NameToWindow filled in an + * error message for us. + */ + + result = TCL_ERROR; + break; + } for (i = 0; i < pwPtr->numSlaves; i++) { if (pwPtr->slaves[i]->tkwin == tkwin) { resultObj = Tk_GetOptionInfo(interp, @@ -2796,6 +2805,7 @@ PanedWindowProxyCommand( PROXY_COORD, PROXY_FORGET, PROXY_PLACE }; int index, x, y, sashWidth, sashHeight; + int internalBW, pwWidth, pwHeight; Tcl_Obj *coords[2]; if (objc < 3) { @@ -2845,11 +2855,16 @@ PanedWindowProxyCommand( return TCL_ERROR; } + internalBW = Tk_InternalBorderWidth(pwPtr->tkwin); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } - y = Tk_InternalBorderWidth(pwPtr->tkwin); + pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); + if (x > pwWidth) { + x = pwWidth; + } + y = Tk_InternalBorderWidth(pwPtr->tkwin); sashWidth = pwPtr->sashWidth; sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderWidth(pwPtr->tkwin)); @@ -2857,6 +2872,10 @@ PanedWindowProxyCommand( if (y < 0) { y = 0; } + pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); + if (y > pwHeight) { + y = pwHeight; + } x = Tk_InternalBorderWidth(pwPtr->tkwin); sashHeight = pwPtr->sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index d230b9f..904065b 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -3647,7 +3647,7 @@ WmWaitMapProc( * This function is invoked by a widget when it wishes to set a grid * coordinate system that controls the size of a top-level window. It * provides a C interface equivalent to the "wm grid" command and is - * usually asscoiated with the -setgrid option. + * usually associated with the -setgrid option. * * Results: * None. diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 9ea4957..2c3b0e4 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -5697,7 +5697,7 @@ WmWaitVisibilityOrMapProc( * This function is invoked by a widget when it wishes to set a grid * coordinate system that controls the size of a top-level window. It * provides a C interface equivalent to the "wm grid" command and is - * usually asscoiated with the -setgrid option. + * usually associated with the -setgrid option. * * Results: * None. |