From 916cdd9441d3e7d714a15a68d1fa435976e38bfa Mon Sep 17 00:00:00 2001 From: vincentdarley Date: Tue, 18 Apr 2006 22:57:21 +0000 Subject: fix tests for TkAqua --- macosx/tkMacOSXWm.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++- tests/text.test | 4 +++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index bd5ad47..af16910 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.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: tkMacOSXWm.c,v 1.30 2006/04/18 22:32:41 vincentdarley Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.31 2006/04/18 23:15:11 vincentdarley Exp $ */ #include "tkMacOSXInt.h" @@ -2933,6 +2933,12 @@ WmTransientCmd(tkwin, winPtr, interp, objc, objv) return TCL_ERROR; } + if (master == winPtr) { + Tcl_AppendResult(interp, "can't make \"", Tk_PathName(winPtr), + "\" its own master", NULL); + return TCL_ERROR; + } + argv3 = Tcl_GetStringFromObj(objv[3], &length); wmPtr->master = Tk_WindowId(master); wmPtr->masterWindowName = ckalloc((unsigned) length+1); @@ -3281,6 +3287,7 @@ UpdateGeometryInfo( TkWindow *winPtr = (TkWindow *) clientData; WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height; + int min, max; unsigned long serial; wmPtr->flags &= ~WM_UPDATE_PENDING; @@ -3307,6 +3314,30 @@ UpdateGeometryInfo( if (width <= 0) { width = 1; } + + /* + * Account for window max/min width + */ + + if (wmPtr->gridWin != NULL) { + min = winPtr->reqWidth + + (wmPtr->minWidth - wmPtr->reqGridWidth)*wmPtr->widthInc; + if (wmPtr->maxWidth > 0) { + max = winPtr->reqWidth + + (wmPtr->maxWidth - wmPtr->reqGridWidth)*wmPtr->widthInc; + } else { + max = 0; + } + } else { + min = wmPtr->minWidth; + max = wmPtr->maxWidth; + } + if (width < min) { + width = min; + } else if ((max > 0) && (width > max)) { + width = max; + } + if (wmPtr->height == -1) { height = winPtr->reqHeight; } else if (wmPtr->gridWin != NULL) { @@ -3320,6 +3351,29 @@ UpdateGeometryInfo( } /* + * Account for window max/min height + */ + + if (wmPtr->gridWin != NULL) { + min = winPtr->reqHeight + + (wmPtr->minHeight - wmPtr->reqGridHeight)*wmPtr->heightInc; + if (wmPtr->maxHeight > 0) { + max = winPtr->reqHeight + + (wmPtr->maxHeight-wmPtr->reqGridHeight)*wmPtr->heightInc; + } else { + max = 0; + } + } else { + min = wmPtr->minHeight; + max = wmPtr->maxHeight; + } + if (height < min) { + height = min; + } else if ((max > 0) && (height > max)) { + height = max; + } + + /* * Compute the new position for the upper-left pixel of the window's * decorative frame. This is tricky, because we need to include the * border widths supplied by a reparented parent in this calculation, diff --git a/tests/text.test b/tests/text.test index 23b8388..91fd703 100644 --- a/tests/text.test +++ b/tests/text.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: text.test,v 1.43 2006/03/28 19:26:52 vincentdarley Exp $ +# RCS: @(#) $Id: text.test,v 1.44 2006/04/18 22:57:21 vincentdarley Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -135,6 +135,8 @@ test text-2.4 {Tk_TextCmd procedure} { } {0 .t2 2 red} if {$tcl_platform(platform) == "windows"} { set relief flat +} elseif {[tk windowingsystem] eq "aqua"} { + set relief solid } else { set relief raised } -- cgit v0.12