diff options
author | fvogel <fvogelnew1@free.fr> | 2017-12-19 21:55:22 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2017-12-19 21:55:22 (GMT) |
commit | 2c313f95514106dcb03e7c44ba33677f68c1f2e4 (patch) | |
tree | 536ab8bf4ba71a4a13c4a86dfb2a4ed3cc3a1908 /generic/tkBusy.c | |
parent | d2b827c75b62eceb222727ff1f22f0c04bf95e1a (diff) | |
download | tk-2c313f95514106dcb03e7c44ba33677f68c1f2e4.zip tk-2c313f95514106dcb03e7c44ba33677f68c1f2e4.tar.gz tk-2c313f95514106dcb03e7c44ba33677f68c1f2e4.tar.bz2 |
Implement TIP #492: Introspection for 'tk busy', with test cases and man page.
Diffstat (limited to 'generic/tkBusy.c')
-rw-r--r-- | generic/tkBusy.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 514465a..b418421 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -761,6 +761,9 @@ HoldBusy( } else { TkpHideBusyWindow(busyPtr); } + if (result == TCL_OK) { + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), -1)); + } return result; } @@ -794,11 +797,12 @@ Tk_BusyObjCmd( Tcl_Obj *objPtr; int index, result = TCL_OK; static const char *const optionStrings[] = { - "cget", "configure", "current", "forget", "hold", "status", NULL + "busywindow", "cget", "configure", "current", "forget", "hold", + "status", NULL }; enum options { - BUSY_CGET, BUSY_CONFIGURE, BUSY_CURRENT, BUSY_FORGET, BUSY_HOLD, - BUSY_STATUS + BUSY_BUSYWINDOW, BUSY_CGET, BUSY_CONFIGURE, BUSY_CURRENT, BUSY_FORGET, + BUSY_HOLD, BUSY_STATUS }; if (objc < 2) { @@ -823,6 +827,18 @@ Tk_BusyObjCmd( return TCL_ERROR; } switch ((enum options) index) { + case BUSY_BUSYWINDOW: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "window"); + return TCL_ERROR; + } + busyPtr = GetBusy(interp, busyTablePtr, objv[2]); + if (busyPtr == NULL) { + return TCL_ERROR; + } + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(busyPtr->tkBusy), -1)); + return TCL_OK; + case BUSY_CGET: if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "window option"); |