summaryrefslogtreecommitdiffstats
path: root/generic/tkScrollbar.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkScrollbar.c')
-rw-r--r--generic/tkScrollbar.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index 9c1ceb8..5017d30 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -179,12 +179,10 @@ Tk_ScrollbarObjCmd(
scrollPtr->sliderLast = 0;
scrollPtr->activeField = 0;
scrollPtr->activeRelief = TK_RELIEF_RAISED;
-#ifndef TK_NO_DEPRECATED
scrollPtr->totalUnits = 0;
scrollPtr->windowUnits = 0;
scrollPtr->firstUnit = 0;
scrollPtr->lastUnit = 0;
-#endif /* TK_NO_DEPRECATED */
scrollPtr->firstFraction = 0.0;
scrollPtr->lastFraction = 0.0;
scrollPtr->cursor = None;
@@ -379,13 +377,10 @@ ScrollbarWidgetObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "get");
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 {
resObjs[0] = Tcl_NewIntObj(scrollPtr->totalUnits);
resObjs[1] = Tcl_NewIntObj(scrollPtr->windowUnits);
@@ -393,7 +388,6 @@ ScrollbarWidgetObjCmd(
resObjs[3] = Tcl_NewIntObj(scrollPtr->lastUnit);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs));
}
-#endif /* TK_NO_DEPRECATED */
break;
}
case COMMAND_IDENTIFY: {
@@ -419,6 +413,8 @@ ScrollbarWidgetObjCmd(
break;
}
case COMMAND_SET: {
+ int totalUnits, windowUnits, firstUnit, lastUnit;
+
if (objc == 4) {
double first, last;
@@ -442,10 +438,8 @@ ScrollbarWidgetObjCmd(
} else {
scrollPtr->lastFraction = last;
}
-#ifndef TK_NO_DEPRECATED
scrollPtr->flags |= NEW_STYLE_COMMANDS;
} else if (objc == 6) {
- int totalUnits, windowUnits, firstUnit, lastUnit;
if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) {
goto error;
}
@@ -483,9 +477,10 @@ ScrollbarWidgetObjCmd(
scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits;
}
scrollPtr->flags &= ~NEW_STYLE_COMMANDS;
-#endif /* !TK_NO_DEPRECATED */
} else {
Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction");
+ Tcl_AppendResult(interp, " or \"", Tcl_GetString(objv[0]),
+ " set totalUnits windowUnits firstUnit lastUnit\"", NULL);
goto error;
}
TkpComputeScrollbarGeometry(scrollPtr);