diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-08-08 07:23:18 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-08-08 07:23:18 (GMT) |
commit | 4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05 (patch) | |
tree | 359b631c47633e5b071ef0d26465d56d36e7eb3d /generic/tkScrollbar.c | |
parent | fca3a144c468de939dced0bcbf211b4228efaec2 (diff) | |
download | tk-4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05.zip tk-4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05.tar.gz tk-4ffe7c28ee0ab1fa2d8b5d9b38e7e2edde3e4c05.tar.bz2 |
Change flag NEW_STYLE_COMMANDS into OLD_STYLE_COMMANDS. This makes it easier to remove the deprecated part in the future.
If building with Tcl > 8, Don't build the compatibility Tk_Photo* (From Tk < 8.4 or so) functions any more.
Diffstat (limited to 'generic/tkScrollbar.c')
-rw-r--r-- | generic/tkScrollbar.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 9c1ceb8..8ace793 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -380,20 +380,18 @@ ScrollbarWidgetObjCmd( goto error; } #ifndef TK_NO_DEPRECATED - if (scrollPtr->flags & NEW_STYLE_COMMANDS) { -#endif /* TK_NO_DEPRECATED */ - resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction); - resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction); - Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs)); -#ifndef TK_NO_DEPRECATED - } else { + if (scrollPtr->flags & OLD_STYLE_COMMANDS) { resObjs[0] = Tcl_NewIntObj(scrollPtr->totalUnits); resObjs[1] = Tcl_NewIntObj(scrollPtr->windowUnits); resObjs[2] = Tcl_NewIntObj(scrollPtr->firstUnit); resObjs[3] = Tcl_NewIntObj(scrollPtr->lastUnit); Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs)); + break; } #endif /* TK_NO_DEPRECATED */ + resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction); + resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction); + Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs)); break; } case COMMAND_IDENTIFY: { @@ -443,7 +441,7 @@ ScrollbarWidgetObjCmd( scrollPtr->lastFraction = last; } #ifndef TK_NO_DEPRECATED - scrollPtr->flags |= NEW_STYLE_COMMANDS; + scrollPtr->flags &= ~OLD_STYLE_COMMANDS; } else if (objc == 6) { int totalUnits, windowUnits, firstUnit, lastUnit; if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) { @@ -482,7 +480,7 @@ ScrollbarWidgetObjCmd( scrollPtr->firstFraction = ((double) firstUnit)/totalUnits; scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits; } - scrollPtr->flags &= ~NEW_STYLE_COMMANDS; + scrollPtr->flags |= OLD_STYLE_COMMANDS; #endif /* !TK_NO_DEPRECATED */ } else { Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction"); |