summaryrefslogtreecommitdiffstats
path: root/generic/tkScrollbar.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-02-17 19:21:15 (GMT)
committernijtmans <nijtmans>2010-02-17 19:21:15 (GMT)
commit08118cf0531836d38a11540a687c8a92842014d5 (patch)
tree7e6bc8a3999b8bdb70d646dd25854cf5e389ba36 /generic/tkScrollbar.c
parent98ad94bf967f4567ae47c4b74ffe11cc12f7d22f (diff)
downloadtk-08118cf0531836d38a11540a687c8a92842014d5.zip
tk-08118cf0531836d38a11540a687c8a92842014d5.tar.gz
tk-08118cf0531836d38a11540a687c8a92842014d5.tar.bz2
CONSTify everything related to Tk_ConfigSpec
Diffstat (limited to 'generic/tkScrollbar.c')
-rw-r--r--generic/tkScrollbar.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index 04e3333..fc93574 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkScrollbar.c,v 1.19 2010/02/16 21:12:56 nijtmans Exp $
+ * RCS: @(#) $Id: tkScrollbar.c,v 1.20 2010/02/17 19:21:16 nijtmans Exp $
*/
#include "tkInt.h"
@@ -26,14 +26,14 @@ static const Tk_CustomOption orientOption = {
TkOrientParseProc, TkOrientPrintProc, (ClientData) NULL
};
-/* static space for "-width" default value */
-static char defScrollbarWidth[TCL_INTEGER_SPACE] = DEF_SCROLLBAR_WIDTH;
+/* non-const space for "-width" default value for scrollbars */
+char tkDefScrollbarWidth[TCL_INTEGER_SPACE] = DEF_SCROLLBAR_WIDTH;
/*
* Information used for argv parsing.
*/
-Tk_ConfigSpec tkpScrollbarConfigSpecs[] = {
+static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground",
DEF_SCROLLBAR_ACTIVE_BG_COLOR, Tk_Offset(TkScrollbar, activeBorder),
TK_CONFIG_COLOR_ONLY, NULL},
@@ -90,7 +90,7 @@ Tk_ConfigSpec tkpScrollbarConfigSpecs[] = {
DEF_SCROLLBAR_TROUGH_MONO, Tk_Offset(TkScrollbar, troughColorPtr),
TK_CONFIG_MONO_ONLY, NULL},
{TK_CONFIG_PIXELS, "-width", "width", "Width",
- defScrollbarWidth, Tk_Offset(TkScrollbar, width), 0, NULL},
+ tkDefScrollbarWidth, Tk_Offset(TkScrollbar, width), 0, NULL},
{TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL}
};
@@ -284,15 +284,15 @@ ScrollbarWidgetCmd(
goto error;
}
result = Tk_ConfigureValue(interp, scrollPtr->tkwin,
- tkpScrollbarConfigSpecs, (char *) scrollPtr, argv[2], 0);
+ configSpecs, (char *) scrollPtr, argv[2], 0);
} else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)
&& (length >= 2)) {
if (argc == 2) {
result = Tk_ConfigureInfo(interp, scrollPtr->tkwin,
- tkpScrollbarConfigSpecs, (char *) scrollPtr, NULL, 0);
+ configSpecs, (char *) scrollPtr, NULL, 0);
} else if (argc == 3) {
result = Tk_ConfigureInfo(interp, scrollPtr->tkwin,
- tkpScrollbarConfigSpecs, (char *) scrollPtr, argv[2], 0);
+ configSpecs, (char *) scrollPtr, argv[2], 0);
} else {
result = ConfigureScrollbar(interp, scrollPtr, argc-2, argv+2,
TK_CONFIG_ARGV_ONLY);
@@ -529,7 +529,7 @@ ConfigureScrollbar(
const char **argv, /* Arguments. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
- if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, tkpScrollbarConfigSpecs,
+ if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs,
argc, argv, (char *) scrollPtr, flags) != TCL_OK) {
return TCL_ERROR;
}
@@ -604,7 +604,7 @@ TkScrollbarEventProc(
* Tk_FreeOptions handle all the standard option-related stuff.
*/
- Tk_FreeOptions(tkpScrollbarConfigSpecs, (char *) scrollPtr,
+ Tk_FreeOptions(configSpecs, (char *) scrollPtr,
scrollPtr->display, 0);
Tcl_EventuallyFree(scrollPtr, TCL_DYNAMIC);
} else if (eventPtr->type == ConfigureNotify) {