summaryrefslogtreecommitdiffstats
path: root/generic/tkObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkObj.c')
-rw-r--r--generic/tkObj.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tkObj.c b/generic/tkObj.c
index b027b0f..7c09656 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -817,11 +817,12 @@ TkGetWindowFromObj(
{
TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr;
register WindowRep *winPtr;
- int result;
- result = Tcl_ConvertToType(interp, objPtr, &windowObjType);
- if (result != TCL_OK) {
- return result;
+ if (objPtr->typePtr != &windowObjType) {
+ int result = SetWindowFromAny(interp, objPtr);
+ if (result != TCL_OK) {
+ return result;
+ }
}
winPtr = objPtr->internalRep.twoPtrValue.ptr1;