summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-06-22 10:13:26 (GMT)
committerhobbs <hobbs>2002-06-22 10:13:26 (GMT)
commitada9b40cb1ed12dff8ae71d167aeeea17bcade14 (patch)
tree960b07c03b8b74ffa66c1e547aa2338cdb07ea74
parent3016d7bb9fdd6c9886c4e501d5e7a1ac0823e9aa (diff)
downloadtk-ada9b40cb1ed12dff8ae71d167aeeea17bcade14.zip
tk-ada9b40cb1ed12dff8ae71d167aeeea17bcade14.tar.gz
tk-ada9b40cb1ed12dff8ae71d167aeeea17bcade14.tar.bz2
* doc/wm.n: TIP #95 Windows implementation and
* mac/tkMacWm.c (Tk_WmCmd): docs with mac and unix stubs. * unix/tkUnixWm.c (Tk_WmCmd): * win/tkWinWm.c (Tk_WmCmd): * tests/unixWm.test: * tests/winWm.test: more wm attr tests will be needed.
-rw-r--r--ChangeLog7
-rw-r--r--doc/wm.n28
-rw-r--r--mac/tkMacWm.c109
-rw-r--r--tests/unixWm.test33
-rw-r--r--tests/winWm.test33
-rw-r--r--unix/tkUnixWm.c14
-rw-r--r--win/tkWinWm.c100
7 files changed, 187 insertions, 137 deletions
diff --git a/ChangeLog b/ChangeLog
index cb26afc..097e2f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2002-06-22 Jeff Hobbs <jeffh@ActiveState.com>
+ * doc/wm.n: TIP #95 Windows implementation and
+ * mac/tkMacWm.c (Tk_WmCmd): docs with mac and unix stubs.
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd):
+ * tests/unixWm.test:
+ * tests/winWm.test: more wm attr tests will be needed.
+
* generic/tkGrid.c (GridReqProc): check that gridPtr is not NULL
(may be when embedded). [Bug #548791] (halliday)
diff --git a/doc/wm.n b/doc/wm.n
index 3ad831e..909b495 100644
--- a/doc/wm.n
+++ b/doc/wm.n
@@ -5,10 +5,10 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: wm.n,v 1.9 2002/06/13 06:33:36 mdejong Exp $
+'\" RCS: @(#) $Id: wm.n,v 1.10 2002/06/22 10:13:26 hobbs Exp $
'\"
.so man.macros
-.TH wm n 4.3 Tk "Tk Built-In Commands"
+.TH wm n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -44,6 +44,30 @@ a Tcl list containing four elements, which are the current values
of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
(if no aspect restrictions are in effect, then an empty string is
returned).
+.VS 8.4
+.TP
+\fBwm attributes \fIwindow\fR
+.TP
+\fBwm attributes \fIwindow\fR ?\fBoption\fR?
+.TP
+\fBwm attributes \fIwindow\fR ?\fBoption value option value...\fR?
+.RS
+This subcommand returns or sets platform specific attributes associated
+with a window. The first form returns a list of the platform specific
+flags and their values. The second form returns the value for the
+specific option. The third form sets one or more of the values. The
+values are as follows:
+.PP
+On Windows, \fB-disabled\fR gets or sets whether the window is in a
+disabled state. \fB-toolwindow\fR gets or sets the style of the window
+to toolwindow (as defined in the MSDN). \fB-topmost\fR gets or sets
+whether this is a topmost window (displays above all other windows).
+.PP
+On Macintosh,
+.PP
+On Unix, there are currently no special attribute values.
+.RE
+.VE 8.4
.TP
\fBwm client \fIwindow\fR ?\fIname\fR?
If \fIname\fR is specified, this command stores \fIname\fR (which
diff --git a/mac/tkMacWm.c b/mac/tkMacWm.c
index 18170be..6770aa9 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.18 2002/06/14 22:25:12 jenglish Exp $
+ * RCS: @(#) $Id: tkMacWm.c,v 1.19 2002/06/22 10:13:26 hobbs Exp $
*/
#include <Gestalt.h>
@@ -739,7 +739,8 @@ Tk_WmCmd(
return TCL_ERROR;
}
wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)) {
+ if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)
+ && (length >= 2)) {
int numer1, denom1, numer2, denom2;
if ((argc != 3) && (argc != 7)) {
@@ -782,6 +783,14 @@ Tk_WmCmd(
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
goto updateGeom;
+ } else if ((c == 'a') && (strncmp(argv[1], "attributes", length) == 0)
+ && (length >= 2)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: must be \"",
+ argv[0], " attributes window",
+ "\"", (char *) NULL);
+ return TCL_ERROR;
+ }
} else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
&& (length >= 2)) {
if ((argc != 3) && (argc != 4)) {
@@ -4120,7 +4129,7 @@ TkUnsupported1Cmd(
Tcl_SetResult(interp, "floatSideZoomProc", TCL_STATIC);
break;
default:
- panic("invalid style");
+ panic("invalid style");
}
if (appearanceSpec) {
Tcl_Obj *attributeList, *newResult;
@@ -4153,11 +4162,11 @@ TkUnsupported1Cmd(
Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("none", -1));
} else if (wmPtr->attributes == kWindowStandardDocumentAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("standardDocument", -1));
} else if (wmPtr->attributes == kWindowStandardFloatingAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
- Tcl_NewStringObj("standardFloating", -1));
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("standardFloating", -1));
} else {
if (wmPtr->attributes & kWindowCloseBoxAttribute) {
Tcl_ListObjAppendElement(interp, attributeList,
@@ -4197,48 +4206,48 @@ TkUnsupported1Cmd(
}
return TCL_OK;
} else if (argc == 4) {
- if (strcmp(argv[3], "documentProc") == 0) {
- wmPtr->style = documentProc;
- } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
- wmPtr->style = documentProc;
- } else if (strcmp(argv[3], "dBoxProc") == 0) {
- wmPtr->style = dBoxProc;
- } else if (strcmp(argv[3], "plainDBox") == 0) {
- wmPtr->style = plainDBox;
- } else if (strcmp(argv[3], "altDBoxProc") == 0) {
- wmPtr->style = altDBoxProc;
- } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
- wmPtr->style = movableDBoxProc;
- } else if (strcmp(argv[3], "zoomDocProc") == 0) {
- wmPtr->style = zoomDocProc;
- } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
- wmPtr->style = zoomNoGrow;
- } else if (strcmp(argv[3], "rDocProc") == 0) {
- wmPtr->style = rDocProc;
- } else if (strcmp(argv[3], "floatProc") == 0) {
- wmPtr->style = floatGrowProc;
- } else if (strcmp(argv[3], "floatGrowProc") == 0) {
- wmPtr->style = floatGrowProc;
- } else if (strcmp(argv[3], "floatZoomProc") == 0) {
- wmPtr->style = floatZoomGrowProc;
- } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
- wmPtr->style = floatZoomGrowProc;
- } else if (strcmp(argv[3], "floatSideProc") == 0) {
- wmPtr->style = floatSideGrowProc;
- } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
- wmPtr->style = floatSideGrowProc;
- } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
- wmPtr->style = floatSideZoomGrowProc;
- } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
- wmPtr->style = floatSideZoomGrowProc;
- } else {
- Tcl_AppendResult(interp, "bad style: should be documentProc, ",
- "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
- "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
- "floatSideProc, or floatSideZoomProc",
- (char *) NULL);
- return TCL_ERROR;
- }
+ if (strcmp(argv[3], "documentProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "dBoxProc") == 0) {
+ wmPtr->style = dBoxProc;
+ } else if (strcmp(argv[3], "plainDBox") == 0) {
+ wmPtr->style = plainDBox;
+ } else if (strcmp(argv[3], "altDBoxProc") == 0) {
+ wmPtr->style = altDBoxProc;
+ } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
+ wmPtr->style = movableDBoxProc;
+ } else if (strcmp(argv[3], "zoomDocProc") == 0) {
+ wmPtr->style = zoomDocProc;
+ } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
+ wmPtr->style = zoomNoGrow;
+ } else if (strcmp(argv[3], "rDocProc") == 0) {
+ wmPtr->style = rDocProc;
+ } else if (strcmp(argv[3], "floatProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatGrowProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatZoomProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else {
+ Tcl_AppendResult(interp, "bad style: should be documentProc, ",
+ "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
+ "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
+ "floatSideProc, or floatSideZoomProc",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
} else if (argc == 5) {
int oldClass = wmPtr->macClass;
int oldAttributes = wmPtr->attributes;
@@ -4278,7 +4287,7 @@ TkUnsupported1Cmd(
if (Tcl_SplitList(interp, argv[4], &attrArgc, &attrArgv) != TCL_OK) {
wmPtr->macClass = oldClass;
Tcl_AppendResult(interp, "Ill-formed attributes list: \"",
- argv[4], "\".", (char *) NULL);
+ argv[4], "\".", (char *) NULL);
return TCL_ERROR;
}
@@ -4341,7 +4350,7 @@ TkUnsupported1Cmd(
(char *) NULL);
return TCL_ERROR;
}
-
+
return TCL_OK;
}
diff --git a/tests/unixWm.test b/tests/unixWm.test
index ea2dbd4..64094fd 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -7,7 +7,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: unixWm.test,v 1.18 2002/06/14 22:52:04 hobbs Exp $
+# RCS: @(#) $Id: unixWm.test,v 1.19 2002/06/22 10:13:26 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -353,7 +353,7 @@ test unixWm-8.9 {icon windows} {nonPortable} {
lappend result [winfo ismapped .icon] [wm state .icon]
} {icon 1 0 0 withdrawn 1 normal}
-test unixWm-59.1 {test for memory leaks} {
+test unixWm-8.10.1 {test for memory leaks} {
wm title .t "This is a long long long long long long title"
wm title .t "This is a long long long long long long title"
wm title .t "This is a long long long long long long title"
@@ -364,7 +364,7 @@ test unixWm-59.1 {test for memory leaks} {
wm title .t "This is a long long long long long long title"
set x 1
} 1
-test unixWm-59.2 {test for memory leaks} {
+test unixWm-8.10.2 {test for memory leaks} {
wm group .t .
wm group .t .
wm group .t .
@@ -888,7 +888,7 @@ test unixWm-24.3 {Tk_WmCmd procedure, "iconmask" option} {
test unixWm-25.1 {Tk_WmCmd procedure, "iconname" option} {
list [catch {wm icon .t} msg] $msg
-} {1 {unknown or ambiguous option "icon": must be aspect, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
+} {1 {unknown or ambiguous option "icon": must be aspect, attributes, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
test unixWm-25.2 {Tk_WmCmd procedure, "iconname" option} {
list [catch {wm iconname .t 12 13} msg] $msg
} {1 {wrong # arguments: must be "wm iconname window ?newName?"}}
@@ -1286,7 +1286,7 @@ test unixWm-38.3 {Tk_WmCmd procedure, "withdraw" option} {
test unixWm-39.1 {Tk_WmCmd procedure, miscellaneous} {
list [catch {wm unknown .t} msg] $msg
-} {1 {unknown or ambiguous option "unknown": must be aspect, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
+} {1 {unknown or ambiguous option "unknown": must be aspect, attributes, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
catch {destroy .t}
catch {destroy .icon}
@@ -2403,22 +2403,19 @@ test unixWm-59.3 {exit processing} {
list $error $msg
} {0 {}}
+test unixWm-60.1 {wm attributes} {
+ destroy .t
+ toplevel .t
+ wm attributes .t
+} {}
+test unixWm-60.2 {wm attributes} {
+ destroy .t
+ toplevel .t
+ list [catch {wm attributes .t -foo} msg] $msg
+} {1 {wrong # arguments: must be "wm attributes window"}}
# cleanup
catch {destroy .t}
catch {removeFile script}
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/winWm.test b/tests/winWm.test
index e9c86c1..72f5919 100644
--- a/tests/winWm.test
+++ b/tests/winWm.test
@@ -9,7 +9,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: winWm.test,v 1.4 2000/01/12 11:45:36 hobbs Exp $
+# RCS: @(#) $Id: winWm.test,v 1.5 2002/06/22 10:13:26 hobbs Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file join [pwd] [file dirname [info script]] defs.tcl]
@@ -229,18 +229,25 @@ test winWm-5.2 {UpdateGeometryInfo: menu resizing} {pcOnly} {
set result
} {50 50 0}
+test winWm-6.1 {wm attributes} {pcOnly} {
+ destroy .t
+ toplevel .t
+ wm attributes .t
+} {-disabled 0 -toolwindow 0 -topmost 0}
+test winWm-6.2 {wm attributes} {pcOnly} {
+ destroy .t
+ toplevel .t
+ wm attributes .t -disabled
+} {0}
+test winWm-6.3 {wm attributes} {pcOnly} {
+ # This isn't quite the correct error message yet, but it works.
+ destroy .t
+ toplevel .t
+ list [catch {wm attributes .t -foo} msg] $msg
+} {1 {wrong # arguments: must be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+
+destroy .t
+
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 5c1f615..cfc1d1c 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.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: tkUnixWm.c,v 1.24 2002/06/22 01:43:47 mdejong Exp $
+ * RCS: @(#) $Id: tkUnixWm.c,v 1.25 2002/06/22 10:13:26 hobbs Exp $
*/
#include "tkPort.h"
@@ -926,7 +926,8 @@ Tk_WmCmd(clientData, interp, argc, argv)
return TCL_ERROR;
}
wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)) {
+ if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)
+ && (length >= 2)) {
int numer1, denom1, numer2, denom2;
if ((argc != 3) && (argc != 7)) {
@@ -969,6 +970,13 @@ Tk_WmCmd(clientData, interp, argc, argv)
}
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
goto updateGeom;
+ } else if ((c == 'a') && (strncmp(argv[1], "attributes", length) == 0)
+ && (length >= 2)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # arguments: must be \"",
+ argv[0], " attributes window\"", (char *) NULL);
+ return TCL_ERROR;
+ }
} else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
&& (length >= 2)) {
if ((argc != 3) && (argc != 4)) {
@@ -2169,7 +2177,7 @@ Tk_WmCmd(clientData, interp, argc, argv)
}
} else {
Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be aspect, client, command, deiconify, ",
+ "\": must be aspect, attributes, client, command, deiconify, ",
"focusmodel, frame, geometry, grid, group, iconbitmap, ",
"iconify, iconmask, iconname, iconposition, ",
"iconwindow, maxsize, minsize, overrideredirect, ",
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 583059f..5532c6e 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.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: tkWinWm.c,v 1.42 2002/06/22 01:43:47 mdejong Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.43 2002/06/22 10:13:26 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -2146,7 +2146,50 @@ Tk_WmCmd(clientData, interp, argc, argv)
return TCL_ERROR;
}
wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "attributes", length) == 0)
+ if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)
+ && (length >= 2)) {
+ int numer1, denom1, numer2, denom2;
+
+ if ((argc != 3) && (argc != 7)) {
+ Tcl_AppendResult(interp, "wrong # arguments: must be \"",
+ argv[0], " aspect window ?minNumer minDenom ",
+ "maxNumer maxDenom?\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (argc == 3) {
+ if (wmPtr->sizeHintsFlags & PAspect) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
+ wmPtr->minAspect.y, wmPtr->maxAspect.x,
+ wmPtr->maxAspect.y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ return TCL_OK;
+ }
+ if (*argv[3] == '\0') {
+ wmPtr->sizeHintsFlags &= ~PAspect;
+ } else {
+ if ((Tcl_GetInt(interp, argv[3], &numer1) != TCL_OK)
+ || (Tcl_GetInt(interp, argv[4], &denom1) != TCL_OK)
+ || (Tcl_GetInt(interp, argv[5], &numer2) != TCL_OK)
+ || (Tcl_GetInt(interp, argv[6], &denom2) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
+ (denom2 <= 0)) {
+ Tcl_SetResult(interp, "aspect number can't be <= 0",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+ wmPtr->minAspect.x = numer1;
+ wmPtr->minAspect.y = denom1;
+ wmPtr->maxAspect.x = numer2;
+ wmPtr->maxAspect.y = denom2;
+ wmPtr->sizeHintsFlags |= PAspect;
+ }
+ goto updateGeom;
+ } else if ((c == 'a') && (strncmp(argv[1], "attributes", length) == 0)
&& (length >= 2)) {
LONG style, exStyle, styleBit, *stylePtr;
char buf[TCL_INTEGER_SPACE];
@@ -2158,8 +2201,8 @@ Tk_WmCmd(clientData, interp, argc, argv)
argv[0], " attributes window",
" ?-disabled ?bool??",
" ?-toolwindow ?bool??",
- " ?-topmost ?bool??\"",
- (char *) NULL);
+ " ?-topmost ?bool??",
+ "\"", (char *) NULL);
return TCL_ERROR;
}
exStyle = wmPtr->exStyleConfig;
@@ -2193,8 +2236,7 @@ Tk_WmCmd(clientData, interp, argc, argv)
&& (length >= 3)) {
stylePtr = &exStyle;
styleBit = WS_EX_TOPMOST;
- if ((i < argc-1) &&
- (winPtr->flags & TK_EMBEDDED)) {
+ if ((i < argc-1) && (winPtr->flags & TK_EMBEDDED)) {
Tcl_AppendResult(interp, "can't set topmost flag on ",
winPtr->pathName, ": it is an embedded window",
(char *) NULL);
@@ -2218,50 +2260,6 @@ Tk_WmCmd(clientData, interp, argc, argv)
wmPtr->exStyleConfig = exStyle;
UpdateWrapper(winPtr);
}
- return TCL_OK;
- } else if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)
- && (length >= 2)) {
- int numer1, denom1, numer2, denom2;
-
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " aspect window ?minNumer minDenom ",
- "maxNumer maxDenom?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PAspect) {
- char buf[TCL_INTEGER_SPACE * 4];
-
- sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
- wmPtr->minAspect.y, wmPtr->maxAspect.x,
- wmPtr->maxAspect.y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~PAspect;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &numer1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &denom1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &numer2) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &denom2) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
- (denom2 <= 0)) {
- Tcl_SetResult(interp, "aspect number can't be <= 0",
- TCL_STATIC);
- return TCL_ERROR;
- }
- wmPtr->minAspect.x = numer1;
- wmPtr->minAspect.y = denom1;
- wmPtr->maxAspect.x = numer2;
- wmPtr->maxAspect.y = denom2;
- wmPtr->sizeHintsFlags |= PAspect;
- }
- goto updateGeom;
} else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
&& (length >= 2)) {
if ((argc != 3) && (argc != 4)) {
@@ -3484,7 +3482,7 @@ Tk_WmCmd(clientData, interp, argc, argv)
TkpWmSetState(winPtr, WithdrawnState);
} else {
Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be aspect, client, command, deiconify, ",
+ "\": must be aspect, attributes, client, command, deiconify, ",
"focusmodel, frame, geometry, grid, group, iconbitmap, ",
"iconify, iconmask, iconname, iconposition, ",
"iconwindow, maxsize, minsize, overrideredirect, ",