diff options
author | mdejong <mdejong> | 2002-05-24 09:50:11 (GMT) |
---|---|---|
committer | mdejong <mdejong> | 2002-05-24 09:50:11 (GMT) |
commit | f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c (patch) | |
tree | be1f7fe17390fe84a32e09b3bb937e0a17ddadad /mac/tkMacWm.c | |
parent | 7232648b41b68bdd036d35aed2b081ba08809e55 (diff) | |
download | tk-f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c.zip tk-f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c.tar.gz tk-f9247ee35c133bb545cb53b9cea7f7a9f3a6fd8c.tar.bz2 |
* mac/tkMacWm.c (Tk_WmCmd):
* tests/unixWm.test: Move wm transient checks over
to wm.test so they will be run on all systems.
* tests/wm.test: Add tests to check for error when
an iconwindow is passed to the wm transient command.
* unix/tkUnixWm.c (Tk_WmCmd):
* win/tkWinWm.c (Tk_WmCmd): Raise an error if one
of the windows passed to the wm transient command
is an iconwindow for another toplevel.
Diffstat (limited to 'mac/tkMacWm.c')
-rw-r--r-- | mac/tkMacWm.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/mac/tkMacWm.c b/mac/tkMacWm.c index 1d2a8c5..ae2cfc5 100644 --- a/mac/tkMacWm.c +++ b/mac/tkMacWm.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacWm.c,v 1.16 2002/05/23 19:55:18 mdejong Exp $ + * RCS: @(#) $Id: tkMacWm.c,v 1.17 2002/05/24 09:50:11 mdejong Exp $ */ #include <Gestalt.h> @@ -1744,6 +1744,7 @@ Tk_WmCmd( } else if ((c == 't') && (strncmp(argv[1], "transient", length) == 0) && (length >= 3)) { Tk_Window master; + WmInfo *wmPtr2; if ((argc != 3) && (argc != 4)) { Tcl_AppendResult(interp, "wrong # arguments: must be \"", @@ -1769,6 +1770,25 @@ Tk_WmCmd( return TCL_ERROR; } Tk_MakeWindowExist(master); + + if (wmPtr->iconFor != NULL) { + Tcl_AppendResult(interp, "can't make \"", argv[2], + "\" a transient: it is an icon for ", + Tk_PathName(wmPtr->iconFor), + (char *) NULL); + return TCL_ERROR; + } + + wmPtr2 = ((TkWindow *) master)->wmInfoPtr; + + if (wmPtr2->iconFor != NULL) { + Tcl_AppendResult(interp, "can't make \"", argv[3], + "\" a master: it is an icon for ", + Tk_PathName(wmPtr2->iconFor), + (char *) NULL); + return TCL_ERROR; + } + wmPtr->master = Tk_WindowId(master); wmPtr->masterWindowName = ckalloc((unsigned) (strlen(argv[3])+1)); strcpy(wmPtr->masterWindowName, argv[3]); |