summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-09-02 23:01:19 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-09-02 23:01:19 (GMT)
commitaf386e0d9c46785104322b873de0997a4022c994 (patch)
tree1fa69462e244e50cb8104f4c53f1f60193f69492
parent0ef46ea496b3ea23a8f88664964a36e400a2a2ed (diff)
downloadtk-af386e0d9c46785104322b873de0997a4022c994.zip
tk-af386e0d9c46785104322b873de0997a4022c994.tar.gz
tk-af386e0d9c46785104322b873de0997a4022c994.tar.bz2
takeFocus -> takeFocusObj
-rw-r--r--generic/tkButton.c10
-rw-r--r--generic/tkButton.h2
-rw-r--r--generic/tkCanvas.c6
-rw-r--r--generic/tkCanvas.h4
-rw-r--r--generic/tkEntry.c4
-rw-r--r--generic/tkEntry.h4
-rw-r--r--generic/tkListbox.c4
-rw-r--r--generic/tkMenu.c2
-rw-r--r--generic/tkMenu.h2
-rw-r--r--generic/tkMenubutton.c6
-rw-r--r--generic/tkMenubutton.h4
-rw-r--r--generic/tkOldConfig.c27
-rw-r--r--generic/tkScale.c4
-rw-r--r--generic/tkScale.h2
-rw-r--r--generic/tkScrollbar.c6
-rw-r--r--generic/tkScrollbar.h4
-rw-r--r--generic/tkText.h6
-rw-r--r--generic/ttk/ttkWidget.h6
18 files changed, 50 insertions, 53 deletions
diff --git a/generic/tkButton.c b/generic/tkButton.c
index 5520bc7..fa441cc 100644
--- a/generic/tkButton.c
+++ b/generic/tkButton.c
@@ -127,7 +127,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = {
DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state),
TK_OPTION_ENUM_VAR, tkStateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_LABEL_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE,
+ DEF_LABEL_TAKE_FOCUS, offsetof(TkButton, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0},
@@ -228,7 +228,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = {
DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state),
TK_OPTION_ENUM_VAR, tkStateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE,
+ DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0},
@@ -333,7 +333,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = {
DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state),
TK_OPTION_ENUM_VAR, tkStateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE,
+ DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0},
@@ -443,7 +443,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = {
DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state),
TK_OPTION_ENUM_VAR, tkStateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusPtr), TCL_INDEX_NONE,
+ DEF_BUTTON_TAKE_FOCUS, offsetof(TkButton, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_BUTTON_TEXT, offsetof(TkButton, textPtr), TCL_INDEX_NONE, 0, 0, 0},
@@ -730,7 +730,7 @@ ButtonCreate(
butPtr->offValuePtr = NULL;
butPtr->tristateValuePtr = NULL;
butPtr->cursor = NULL;
- butPtr->takeFocusPtr = NULL;
+ butPtr->takeFocusObj = NULL;
butPtr->commandPtr = NULL;
butPtr->flags = 0;
diff --git a/generic/tkButton.h b/generic/tkButton.h
index 592e2dc..c3a8070 100644
--- a/generic/tkButton.h
+++ b/generic/tkButton.h
@@ -227,7 +227,7 @@ typedef struct {
Tk_Cursor cursor; /* Value of -cursor option: if not NULL,
* specifies current cursor for window. */
- Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
* scripts. */
Tcl_Obj *commandPtr; /* Value of -command option: specifies script
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index e4c8b56..aaf8644 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -162,8 +162,8 @@ static const Tk_ConfigSpec configSpecs[] = {
"normal", offsetof(TkCanvas, canvas_state), TK_CONFIG_DONT_SET_DEFAULT,
&stateOption},
{TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_CANVAS_TAKE_FOCUS, offsetof(TkCanvas, takeFocus),
- TK_CONFIG_NULL_OK, NULL},
+ DEF_CANVAS_TAKE_FOCUS, offsetof(TkCanvas, takeFocusObj),
+ TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL},
{TK_CONFIG_PIXELS, "-width", "width", "Width",
DEF_CANVAS_WIDTH, offsetof(TkCanvas, width), 0, NULL},
{TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
@@ -732,7 +732,7 @@ Tk_CanvasObjCmd(
canvasPtr->hotPtr = NULL;
canvasPtr->hotPrevPtr = NULL;
canvasPtr->cursor = NULL;
- canvasPtr->takeFocus = NULL;
+ canvasPtr->takeFocusObj = NULL;
canvasPtr->pixelsPerMM = WidthOfScreen(Tk_Screen(newWin));
canvasPtr->pixelsPerMM /= WidthMMOfScreen(Tk_Screen(newWin));
canvasPtr->flags = 0;
diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h
index 5c88892..af0d654 100644
--- a/generic/tkCanvas.h
+++ b/generic/tkCanvas.h
@@ -207,9 +207,9 @@ typedef struct TkCanvas {
*/
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
- char *takeFocus; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ * scripts. May be NULL. */
double pixelsPerMM; /* Scale factor between MM and pixels; used
* when converting coordinates. */
int flags; /* Various flags; see below for
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 4a28a45..f989fd0 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -151,7 +151,7 @@ static const Tk_OptionSpec entryOptSpec[] = {
DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state),
0, stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_ENTRY_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Entry, takeFocus),
+ DEF_ENTRY_TAKE_FOCUS, offsetof(Entry, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
DEF_ENTRY_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Entry, textVarName),
@@ -300,7 +300,7 @@ static const Tk_OptionSpec sbOptSpec[] = {
DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state),
0, stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_ENTRY_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Entry, takeFocus),
+ DEF_ENTRY_TAKE_FOCUS, offsetof(Entry, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
DEF_ENTRY_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Entry, textVarName),
diff --git a/generic/tkEntry.h b/generic/tkEntry.h
index 72bffcf..7a4cfa5 100644
--- a/generic/tkEntry.h
+++ b/generic/tkEntry.h
@@ -115,9 +115,9 @@ typedef struct {
* non-NULL, entry's string tracks the
* contents of this variable and vice
* versa. */
- char *takeFocus; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ * scripts. May be NULL. */
int prefWidth; /* Desired width of window, measured in
* average characters. */
char *scrollCmd; /* Command prefix for communicating with
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index d09b503..6f7a92c 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -149,7 +149,7 @@ typedef struct {
*/
Tk_Cursor cursor; /* Current cursor for window, or None. */
- char *takeFocus; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
* scripts. Malloc'ed, but may be NULL. */
char *yScrollCmd; /* Command prefix for communicating with
@@ -294,7 +294,7 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_LISTBOX_STATE, TCL_INDEX_NONE, offsetof(Listbox, state),
0, &tkStateStrings[1], 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_LISTBOX_TAKE_FOCUS, TCL_INDEX_NONE, offsetof(Listbox, takeFocus),
+ DEF_LISTBOX_TAKE_FOCUS, offsetof(Listbox, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_INT, "-width", "width", "Width",
DEF_LISTBOX_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, width), 0, 0, 0},
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 019a881..465660c 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -284,7 +284,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = {
DEF_MENU_SELECT_MONO, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_MENU_TAKE_FOCUS,
- offsetof(TkMenu, takeFocusPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
+ offsetof(TkMenu, takeFocusObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0},
{TK_OPTION_BOOLEAN, "-tearoff", "tearOff", "TearOff",
DEF_MENU_TEAROFF, TCL_INDEX_NONE, offsetof(TkMenu, tearoff), 0, NULL, 0},
{TK_OPTION_STRING, "-tearoffcommand", "tearOffCommand",
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index 5f77128..50d900a 100644
--- a/generic/tkMenu.h
+++ b/generic/tkMenu.h
@@ -334,7 +334,7 @@ typedef struct TkMenu {
* be used to generate a title for tearoff. */
Tcl_Obj *tearoffCommandPtr; /* If non-NULL, points to a command to run
* whenever the menu is torn-off. */
- Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
* scripts. Malloc'ed, but may be NULL. */
Tcl_Obj *cursorPtr; /* Current cursor for window, or NULL. */
diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c
index d7d2850..433cbf1 100644
--- a/generic/tkMenubutton.c
+++ b/generic/tkMenubutton.c
@@ -119,8 +119,8 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_MENUBUTTON_STATE, TCL_INDEX_NONE, offsetof(TkMenuButton, state),
TK_OPTION_ENUM_VAR, tkStateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_MENUBUTTON_TAKE_FOCUS, TCL_INDEX_NONE,
- offsetof(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0},
+ DEF_MENUBUTTON_TAKE_FOCUS, offsetof(TkMenuButton, takeFocusObj),
+ TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_STRING, "-text", "text", "Text",
DEF_MENUBUTTON_TEXT, TCL_INDEX_NONE, offsetof(TkMenuButton, text), 0, 0, 0},
{TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
@@ -280,7 +280,7 @@ Tk_MenubuttonObjCmd(
mbPtr->indicatorHeight = 0;
mbPtr->direction = DIRECTION_FLUSH;
mbPtr->cursor = NULL;
- mbPtr->takeFocus = NULL;
+ mbPtr->takeFocusObj = NULL;
mbPtr->flags = 0;
mbPtr->borderWidthObj = NULL;
mbPtr->highlightWidthObj = NULL;
diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h
index 1c8d175..f5f8d11 100644
--- a/generic/tkMenubutton.h
+++ b/generic/tkMenubutton.h
@@ -171,9 +171,9 @@ typedef struct {
* or right, and the active item will be next
* to the button. */
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
- char *takeFocus; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ * scripts. May be NULL. */
int flags; /* Various flags; see below for
* definitions. */
#ifdef BUILD_tk
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index 387ed56..163ad45 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -189,14 +189,9 @@ Tk_ConfigureWidget(
}
Tcl_DecrRefCount(arg);
} else {
- if (specPtr->defValue != NULL) {
- value = Tk_GetUid(specPtr->defValue);
- } else {
- value = NULL;
- }
- if ((value != NULL) && !(specPtr->specFlags
+ if ((specPtr->defValue != NULL) && !(specPtr->specFlags
& TK_CONFIG_DONT_SET_DEFAULT)) {
- Tcl_Obj *arg = Tcl_NewStringObj(value, TCL_INDEX_NONE);
+ Tcl_Obj *arg = Tcl_NewStringObj(specPtr->defValue, TCL_INDEX_NONE);
Tcl_IncrRefCount(arg);
if (DoConfig(interp, tkwin, specPtr, arg, widgRec) !=
TCL_OK) {
@@ -351,7 +346,8 @@ DoConfig(
nullValue = 1;
}
- if ((specPtr->specFlags & TK_CONFIG_OBJS) && (specPtr->type != TK_CONFIG_PIXELS)) {
+ if ((specPtr->specFlags & TK_CONFIG_OBJS) && (specPtr->type != TK_CONFIG_STRING)
+ && (specPtr->type != TK_CONFIG_PIXELS)) {
/* Prevent surprises for other options than TK_CONFIG_PIXELS */
Tcl_AppendResult(interp, "TK_CONFIG_OBJS not supported", (char *)NULL);
return TCL_ERROR;
@@ -382,13 +378,20 @@ DoConfig(
if (nullValue) {
newStr = NULL;
+ } else if (specPtr->specFlags & TK_CONFIG_OBJS) {
+ Tcl_IncrRefCount(arg);
+ newStr = (char *)arg;
} else {
newStr = (char *)ckalloc(strlen(value) + 1);
strcpy(newStr, value);
}
oldStr = *((char **)ptr);
if (oldStr != NULL) {
- ckfree(oldStr);
+ if (specPtr->specFlags & TK_CONFIG_OBJS) {
+ Tcl_DecrRefCount((Tcl_Obj *)oldStr);
+ } else {
+ ckfree(oldStr);
+ }
}
*((char **)ptr) = newStr;
break;
@@ -424,7 +427,7 @@ DoConfig(
if (nullValue) {
newFont = NULL;
} else {
- newFont = Tk_GetFont(interp, tkwin, value);
+ newFont = Tk_AllocFontFromObj(interp, tkwin, arg);
if (newFont == NULL) {
return TCL_ERROR;
}
@@ -439,7 +442,7 @@ DoConfig(
if (nullValue) {
newBmp = None;
} else {
- newBmp = Tk_GetBitmap(interp, tkwin, value);
+ newBmp = Tk_AllocBitmapFromObj(interp, tkwin, arg);
if (newBmp == None) {
return TCL_ERROR;
}
@@ -811,7 +814,7 @@ FormatConfigValue(
result = buffer;
break;
case TK_CONFIG_STRING:
- result = (*(char **)ptr);
+ result = *(char **)ptr;
if (result == NULL) {
result = "";
}
diff --git a/generic/tkScale.c b/generic/tkScale.c
index c55ebfd..4f7be5a 100644
--- a/generic/tkScale.c
+++ b/generic/tkScale.c
@@ -111,7 +111,7 @@ static const Tk_OptionSpec optionSpecs[] = {
DEF_SCALE_STATE, TCL_INDEX_NONE, offsetof(TkScale, state),
TK_OPTION_ENUM_VAR, tkStateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_SCALE_TAKE_FOCUS, offsetof(TkScale, takeFocusPtr), TCL_INDEX_NONE,
+ DEF_SCALE_TAKE_FOCUS, offsetof(TkScale, takeFocusObj), TCL_INDEX_NONE,
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_DOUBLE, "-tickinterval", "tickInterval", "TickInterval",
DEF_SCALE_TICK_INTERVAL, TCL_INDEX_NONE, offsetof(TkScale, tickInterval),
@@ -324,7 +324,7 @@ Tk_ScaleObjCmd(
scalePtr->vertLabelX = 0;
scalePtr->fontHeight = 0;
scalePtr->cursor = NULL;
- scalePtr->takeFocusPtr = NULL;
+ scalePtr->takeFocusObj = NULL;
scalePtr->flags = NEVER_SET;
diff --git a/generic/tkScale.h b/generic/tkScale.h
index 4a59901..5079d1b 100644
--- a/generic/tkScale.h
+++ b/generic/tkScale.h
@@ -154,7 +154,7 @@ typedef struct TkScale {
int fontHeight; /* Height of scale font. */
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
- Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
* scripts. May be NULL. */
int flags; /* Various flags; see below for
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index eaf3314..6b4c41e 100644
--- a/generic/tkScrollbar.c
+++ b/generic/tkScrollbar.c
@@ -79,8 +79,8 @@ static const Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
DEF_SCROLLBAR_REPEAT_INTERVAL, offsetof(TkScrollbar, repeatInterval), 0, NULL},
{TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_SCROLLBAR_TAKE_FOCUS, offsetof(TkScrollbar, takeFocus),
- TK_CONFIG_NULL_OK, NULL},
+ DEF_SCROLLBAR_TAKE_FOCUS, offsetof(TkScrollbar, takeFocusObj),
+ TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL},
{TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background",
DEF_SCROLLBAR_TROUGH_COLOR, offsetof(TkScrollbar, troughColorPtr),
TK_CONFIG_COLOR_ONLY, NULL},
@@ -181,7 +181,7 @@ Tk_ScrollbarObjCmd(
scrollPtr->firstFraction = 0.0;
scrollPtr->lastFraction = 0.0;
scrollPtr->cursor = NULL;
- scrollPtr->takeFocus = NULL;
+ scrollPtr->takeFocusObj = NULL;
scrollPtr->flags = 0;
if (ConfigureScrollbar(interp, scrollPtr, objc-2, objv+2, 0) != TCL_OK) {
diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h
index 39f8bb0..f079469 100644
--- a/generic/tkScrollbar.h
+++ b/generic/tkScrollbar.h
@@ -108,9 +108,9 @@ typedef struct TkScrollbar {
*/
Tk_Cursor cursor; /* Current cursor for window, or NULL. */
- char *takeFocus; /* Value of -takefocus option; not used in the
+ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the
* C code, but used by keyboard traversal
- * scripts. Malloc'ed, but may be NULL. */
+ * scripts. May be NULL. */
int flags; /* Various flags; see below for
* definitions. */
} TkScrollbar;
diff --git a/generic/tkText.h b/generic/tkText.h
index 506f7e8..e89ed6d 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -841,7 +841,6 @@ typedef struct TkText {
* Miscellaneous additional information:
*/
-#if TK_MAJOR_VERSION > 8
Tcl_Obj *takeFocusObj; /* Value of -takeFocus option; not used in the
* C code, but used by keyboard traversal
* scripts. Malloc'ed, but may be NULL. */
@@ -849,11 +848,6 @@ typedef struct TkText {
* horizontal scrollbar when view changes. */
Tcl_Obj *yScrollCmdObj; /* Prefix of command to issue to update
* vertical scrollbar when view changes. */
-#else
- char *takeFocus;
- char *xScrollCmd;
- char *yScrollCmd;
-#endif
int flags; /* Miscellaneous flags; see below for
* definitions. */
Tk_OptionTable optionTable; /* Token representing the configuration
diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h
index 453b788..54a542c 100644
--- a/generic/ttk/ttkWidget.h
+++ b/generic/ttk/ttkWidget.h
@@ -38,7 +38,7 @@ typedef struct
/*
* Storage for resources:
*/
- Tcl_Obj *takeFocusPtr; /* Storage for -takefocus option */
+ Tcl_Obj *takeFocusObj; /* Storage for -takefocus option */
Tcl_Obj *cursorObj; /* Storage for -cursor option */
Tcl_Obj *styleObj; /* Name of currently-applied style */
Tcl_Obj *classObj; /* Class name (readonly option) */
@@ -124,10 +124,10 @@ MODULE_SCOPE Tcl_ObjCmdProc2 TtkWidgetConstructorObjCmd;
*/
#define WIDGET_TAKEFOCUS_TRUE \
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \
- "ttk::takefocus", offsetof(WidgetCore, takeFocusPtr), TCL_INDEX_NONE, 0,0,0 }
+ "ttk::takefocus", offsetof(WidgetCore, takeFocusObj), TCL_INDEX_NONE, 0,0,0 }
#define WIDGET_TAKEFOCUS_FALSE \
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \
- "", offsetof(WidgetCore, takeFocusPtr), TCL_INDEX_NONE, 0,0,0 }
+ "", offsetof(WidgetCore, takeFocusObj), TCL_INDEX_NONE, 0,0,0 }
/* WIDGET_INHERIT_OPTIONS(baseOptionSpecs) --
* Add this at the end of an OptionSpecs table to inherit