diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-23 13:59:40 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-23 13:59:40 (GMT) |
commit | 571fd220b0be2da05b1a6e8bb32e0b9a447ed288 (patch) | |
tree | 46a3064598e4a36c7ca561f9c08f5d22de4b2b9e /generic/tkFocus.c | |
parent | ed7fb54396eee6e5122bfe611b2a14cf422970fa (diff) | |
download | tk-571fd220b0be2da05b1a6e8bb32e0b9a447ed288.zip tk-571fd220b0be2da05b1a6e8bb32e0b9a447ed288.tar.gz tk-571fd220b0be2da05b1a6e8bb32e0b9a447ed288.tar.bz2 |
Much more cleaning up of result handling.
Diffstat (limited to 'generic/tkFocus.c')
-rw-r--r-- | generic/tkFocus.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 2f50009..b5e2edf 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -115,7 +115,7 @@ Tk_FocusObjCmd( }; Tk_Window tkwin = clientData; TkWindow *winPtr = clientData; - TkWindow *newPtr, *focusWinPtr, *topLevelPtr; + TkWindow *newPtr, *topLevelPtr; ToplevelFocusInfo *tlFocusPtr; const char *windowName; int index; @@ -125,9 +125,10 @@ Tk_FocusObjCmd( */ if (objc == 1) { - focusWinPtr = TkGetFocusWin(winPtr); - if (focusWinPtr != NULL) { - Tcl_SetResult(interp, focusWinPtr->pathName, TCL_STATIC); + Tk_Window focusWin = (Tk_Window) TkGetFocusWin(winPtr); + + if (focusWin != NULL) { + Tcl_SetObjResult(interp, TkNewWindowObj(focusWin)); } return TCL_OK; } @@ -180,7 +181,7 @@ Tk_FocusObjCmd( } newPtr = TkGetFocusWin(newPtr); if (newPtr != NULL) { - Tcl_SetResult(interp, newPtr->pathName, TCL_STATIC); + Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) newPtr)); } break; case 1: /* -force */ @@ -213,12 +214,12 @@ Tk_FocusObjCmd( for (tlFocusPtr = newPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL; tlFocusPtr = tlFocusPtr->nextPtr) { if (tlFocusPtr->topLevelPtr == topLevelPtr) { - Tcl_SetResult(interp, - tlFocusPtr->focusWinPtr->pathName, TCL_STATIC); + Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) + tlFocusPtr->focusWinPtr)); return TCL_OK; } } - Tcl_SetResult(interp, topLevelPtr->pathName, TCL_STATIC); + Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) topLevelPtr)); return TCL_OK; } break; |