summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/ttk/ttkInit.c30
-rw-r--r--generic/ttk/ttkTheme.h4
-rw-r--r--macosx/tkMacOSXDialog.c4
-rw-r--r--macosx/tkMacOSXWm.c56
-rw-r--r--unix/tkUnixWm.c4
-rw-r--r--win/tkWinDialog.c16
-rw-r--r--win/tkWinSysTray.c4
-rw-r--r--win/tkWinWm.c28
-rw-r--r--win/ttkWinXPTheme.c12
9 files changed, 79 insertions, 79 deletions
diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c
index 2672a0b..3829f09 100644
--- a/generic/ttk/ttkInit.c
+++ b/generic/ttk/ttkInit.c
@@ -13,15 +13,15 @@
* See also: enum Ttk_ButtonDefaultState.
*/
const char *const ttkDefaultStrings[] = {
- "normal", "active", "disabled", NULL
+ "active", "disabled", "normal", NULL
};
int Ttk_GetButtonDefaultStateFromObj(
Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_ButtonDefaultState *statePtr)
{
int state = (int)TTK_BUTTON_DEFAULT_DISABLED;
- int result = Tcl_GetIndexFromObjStruct(interp, objPtr, ttkDefaultStrings,
- sizeof(char *), "default state", 0, &state);
+ int result = Tcl_GetIndexFromObj(interp, objPtr, ttkDefaultStrings,
+ "default state", 0, &state);
*statePtr = (Ttk_ButtonDefaultState)state;
return result;
@@ -40,8 +40,8 @@ int Ttk_GetCompoundFromObj(
Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Compound *compoundPtr)
{
int compound = (int)TTK_COMPOUND_NONE;
- int result = Tcl_GetIndexFromObjStruct(interp, objPtr, ttkCompoundStrings,
- sizeof(char *), "compound layout", 0, &compound);
+ int result = Tcl_GetIndexFromObj(interp, objPtr, ttkCompoundStrings,
+ "compound layout", 0, &compound);
*compoundPtr = (Ttk_Compound)compound;
return result;
@@ -60,8 +60,8 @@ int Ttk_GetOrientFromObj(
Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr)
{
*resultPtr = TTK_ORIENT_HORIZONTAL;
- return Tcl_GetIndexFromObjStruct(interp, objPtr, ttkOrientStrings,
- sizeof(char *), "orientation", 0, resultPtr);
+ return Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings,
+ "orientation", 0, resultPtr);
}
#endif
@@ -69,8 +69,8 @@ int TtkGetOrientFromObj(
Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr)
{
int orient = (int)TTK_ORIENT_HORIZONTAL;
- int result = Tcl_GetIndexFromObjStruct(interp, objPtr, ttkOrientStrings,
- sizeof(char *), "orientation", 0, &orient);
+ int result = Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings,
+ "orientation", 0, &orient);
*resultPtr = (Ttk_Orient)orient;
return result;
@@ -81,13 +81,13 @@ int TtkGetOrientFromObj(
* Other options are accepted and interpreted as synonyms for "normal".
*/
static const char *const ttkStateStrings[] = {
- "normal", "readonly", "disabled", "active", NULL
+ "active", "disabled", "normal", "readonly", NULL
};
enum {
- TTK_COMPAT_STATE_NORMAL,
- TTK_COMPAT_STATE_READONLY,
+ TTK_COMPAT_STATE_ACTIVE,
TTK_COMPAT_STATE_DISABLED,
- TTK_COMPAT_STATE_ACTIVE
+ TTK_COMPAT_STATE_NORMAL,
+ TTK_COMPAT_STATE_READONLY
};
/* TtkCheckStateOption --
@@ -104,8 +104,8 @@ void TtkCheckStateOption(WidgetCore *corePtr, Tcl_Obj *objPtr)
unsigned all = TTK_STATE_DISABLED|TTK_STATE_READONLY|TTK_STATE_ACTIVE;
# define SETFLAGS(f) TtkWidgetChangeState(corePtr, f, all^f)
- (void)Tcl_GetIndexFromObjStruct(NULL, objPtr, ttkStateStrings,
- sizeof(char *), "", 0, &stateOption);
+ Tcl_GetIndexFromObj(NULL, objPtr, ttkStateStrings,
+ "", 0, &stateOption);
switch (stateOption) {
case TTK_COMPAT_STATE_NORMAL:
default:
diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h
index 4da5da3..3364971 100644
--- a/generic/ttk/ttkTheme.h
+++ b/generic/ttk/ttkTheme.h
@@ -351,9 +351,9 @@ TTKAPI Tk_Image TtkSelectImage(Ttk_ImageSpec *, Ttk_State);
*/
typedef enum /* -default option values */
{
- TTK_BUTTON_DEFAULT_NORMAL, /* widget defaultable */
TTK_BUTTON_DEFAULT_ACTIVE, /* currently the default widget */
- TTK_BUTTON_DEFAULT_DISABLED /* not defaultable */
+ TTK_BUTTON_DEFAULT_DISABLED, /* not defaultable */
+ TTK_BUTTON_DEFAULT_NORMAL /* widget defaultable */
} Ttk_ButtonDefaultState;
TTKAPI int Ttk_GetButtonDefaultStateFromObj(Tcl_Interp *, Tcl_Obj *, Ttk_ButtonDefaultState *);
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 528b0f2..64bbd71 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -1587,11 +1587,11 @@ static NSFont *fontPanelFont = nil;
static NSMutableDictionary *fontPanelFontAttributes = nil;
static const char *const fontchooserOptionStrings[] = {
- "-parent", "-title", "-font", "-command",
+ "-command", "-font", "-parent", "-title",
"-visible", NULL
};
enum FontchooserOption {
- FontchooserParent, FontchooserTitle, FontchooserFont, FontchooserCmd,
+ FontchooserCmd, FontchooserFont, FontchooserParent, FontchooserTitle,
FontchooserVisible
};
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index b273030..39da1eb 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -1272,8 +1272,8 @@ Tk_WmObjCmd(
return Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing);
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
- sizeof(char *), "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings,
+ "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -1682,8 +1682,8 @@ WmAttributesCmd(
}
Tcl_SetObjResult(interp, result);
} else if (objc == 4) { /* wm attributes $win -attribute */
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], WmAttributeNames,
- sizeof(char *), "attribute", 0, &attribute) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], WmAttributeNames,
+ "attribute", 0, &attribute) != TCL_OK) {
return TCL_ERROR;
}
Tcl_SetObjResult(interp, WmGetAttribute(winPtr, macWindow, (WmAttribute)attribute));
@@ -1691,8 +1691,8 @@ WmAttributesCmd(
int i;
for (i = 3; i < objc; i += 2) {
- if (Tcl_GetIndexFromObjStruct(interp, objv[i], WmAttributeNames,
- sizeof(char *), "attribute", 0, &attribute) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], WmAttributeNames,
+ "attribute", 0, &attribute) != TCL_OK) {
return TCL_ERROR;
}
if (WmSetAttribute(winPtr, macWindow, interp, (WmAttribute)attribute, objv[i+1])
@@ -2031,8 +2031,8 @@ WmFocusmodelCmd(
return TCL_OK;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_ACTIVE) {
@@ -3243,8 +3243,8 @@ WmPositionfromCmd(
if (*Tcl_GetString(objv[3]) == '\0') {
wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
} else {
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_USER) {
@@ -3489,8 +3489,8 @@ WmSizefromCmd(
if (*Tcl_GetString(objv[3]) == '\0') {
wmPtr->sizeHintsFlags &= ~(USSize|PSize);
} else {
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_USER) {
@@ -3618,8 +3618,8 @@ WmStackorderCmd(
ckfree(windows);
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_ISABOVE) {
@@ -3659,9 +3659,9 @@ WmStateCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
- "normal", "iconic", "withdrawn", "zoomed", NULL };
+ "iconic", "normal", "withdrawn", "zoomed", NULL };
enum options {
- OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED };
+ OPT_ICONIC, OPT_NORMAL, OPT_WITHDRAWN, OPT_ZOOMED };
int index;
if ((objc < 3) || (objc > 4)) {
@@ -3685,8 +3685,8 @@ WmStateCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -5741,10 +5741,10 @@ TkUnsupported1ObjCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
static const char *const subcmds[] = {
- "style", "tabbingid", "appearance", "isdark", NULL
+ "appearance", "isdark", "style", "tabbingid", NULL
};
enum SubCmds {
- TKMWS_STYLE, TKMWS_TABID, TKMWS_APPEARANCE, TKMWS_ISDARK
+ TKMWS_APPEARANCE, TKMWS_ISDARK, TKMWS_STYLE, TKMWS_TABID
};
Tk_Window tkwin = (Tk_Window)clientData;
TkWindow *winPtr;
@@ -5767,8 +5767,8 @@ TkUnsupported1ObjCmd(
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmds,
- sizeof(char *), "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], subcmds,
+ "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch((enum SubCmds) index) {
@@ -6134,10 +6134,10 @@ WmWinAppearance(
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED > 1090
static const char *const appearanceStrings[] = {
- "aqua", "darkaqua", "auto", NULL
+ "aqua", "auto", "darkaqua", NULL
};
enum appearances {
- APPEARANCE_AQUA, APPEARANCE_DARKAQUA, APPEARANCE_AUTO
+ APPEARANCE_AQUA, APPEARANCE_AUTO, APPEARANCE_DARKAQUA
};
Tcl_Obj *result = NULL;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
@@ -6169,10 +6169,10 @@ WmWinAppearance(
}
if (objc == 4) {
int index;
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], appearanceStrings,
- sizeof(char *), "appearancename", 0, &index) != TCL_OK) {
- return TCL_ERROR;
- }
+ if (Tcl_GetIndexFromObj(interp, objv[3], appearanceStrings,
+ "appearancename", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
switch ((enum appearances) index) {
case APPEARANCE_AQUA:
win.appearance = [NSAppearance appearanceNamed:
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 3f69f8a..a49fdc3 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -3415,9 +3415,9 @@ WmStateCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
- "normal", "iconic", "withdrawn", NULL };
+ "iconic", "normal", "withdrawn", NULL };
enum options {
- OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN };
+ OPT_ICONIC, OPT_NORMAL, OPT_WITHDRAWN };
int index;
if ((objc < 3) || (objc > 4)) {
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 07997e2..0bfc7f1 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -744,8 +744,8 @@ Tk_ChooseColorObjCmd(
optionPtr = objv[i];
valuePtr = objv[i + 1];
- if (Tcl_GetIndexFromObjStruct(interp, optionPtr, optionStrings,
- sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings,
+ "option", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
if (i + 1 == objc) {
@@ -2767,8 +2767,8 @@ Tk_MessageBoxObjCmd(
optionPtr = objv[i];
valuePtr = objv[i + 1];
- if (Tcl_GetIndexFromObjStruct(interp, optionPtr, optionStrings,
- sizeof(char *), "option", TCL_EXACT, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings,
+ "option", TCL_EXACT, &index) != TCL_OK) {
return TCL_ERROR;
}
if (i + 1 == objc) {
@@ -3164,7 +3164,7 @@ HookProc(
*/
enum FontchooserOption {
- FontchooserParent, FontchooserTitle, FontchooserFont, FontchooserCmd,
+ FontchooserCmd, FontchooserFont, FontchooserParent, FontchooserTitle,
FontchooserVisible
};
@@ -3241,7 +3241,7 @@ FontchooserConfigureCmd(
HookData *hdPtr = NULL;
int i, r = TCL_OK;
static const char *const optionStrings[] = {
- "-parent", "-title", "-font", "-command", "-visible", NULL
+ "-command", "-font", "-parent", "-title", "-visible", NULL
};
hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL);
@@ -3268,8 +3268,8 @@ FontchooserConfigureCmd(
for (i = 1; i < objc; i += 2) {
int optionIndex;
- if (Tcl_GetIndexFromObjStruct(interp, objv[i], optionStrings,
- sizeof(char *), "option", 0, &optionIndex) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,
+ "option", 0, &optionIndex) != TCL_OK) {
return TCL_ERROR;
}
if (objc == 2) {
diff --git a/win/tkWinSysTray.c b/win/tkWinSysTray.c
index 73d5d37..b71a301 100644
--- a/win/tkWinSysTray.c
+++ b/win/tkWinSysTray.c
@@ -925,9 +925,9 @@ WinSystrayCmd(
};
enum { CMD_ADD, CMD_DELETE, CMD_MODIFY };
static const char *const optStrings[] = {
- "-image", "-text", "-callback", NULL
+ "-callback", "-image", "-text", NULL
};
- enum { OPT_IMAGE, OPT_TEXT, OPT_CALLBACK };
+ enum { OPT_CALLBACK, OPT_IMAGE, OPT_TEXT };
int cmd, opt;
HICON hIcon;
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 87c236e..e568f0c 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -2721,8 +2721,8 @@ Tk_WmObjCmd(
return TCL_OK;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[1], optionStrings,
- sizeof(char *), "option", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings,
+ "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -3514,8 +3514,8 @@ WmFocusmodelCmd(
return TCL_OK;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0,&index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0,&index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_ACTIVE) {
@@ -4829,8 +4829,8 @@ WmPositionfromCmd(
if (*Tcl_GetString(objv[3]) == '\0') {
wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
} else {
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_USER) {
@@ -5056,8 +5056,8 @@ WmSizefromCmd(
if (*Tcl_GetString(objv[3]) == '\0') {
wmPtr->sizeHintsFlags &= ~(USSize|PSize);
} else {
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_USER) {
@@ -5186,8 +5186,8 @@ WmStackorderCmd(
ckfree(windows);
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == OPT_ISABOVE) {
@@ -5227,10 +5227,10 @@ WmStateCmd(
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
static const char *const optionStrings[] = {
- "normal", "iconic", "withdrawn", "zoomed", NULL
+ "iconic", "normal", "withdrawn", "zoomed", NULL
};
enum options {
- OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED
+ OPT_ICONIC, OPT_NORMAL, OPT_WITHDRAWN, OPT_ZOOMED
};
int index;
@@ -5246,8 +5246,8 @@ WmStateCmd(
Tcl_SetErrorCode(interp, "TK", "WM", "STATE", "ICON", NULL);
return TCL_ERROR;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[3], optionStrings,
- sizeof(char *), "argument", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings,
+ "argument", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 2500ea2..6917192 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -1127,10 +1127,10 @@ Ttk_CreateVsapiElement(
Tcl_DString classBuf;
static const char *const optionStrings[] =
- { "-padding","-width","-height","-margins", "-syssize",
- "-halfheight", "-halfwidth", NULL };
- enum { O_PADDING, O_WIDTH, O_HEIGHT, O_MARGINS, O_SYSSIZE,
- O_HALFHEIGHT, O_HALFWIDTH };
+ { "-halfheight", "-halfwidth", "-height", "-margins", "-padding",
+ "-syssize", "-width", NULL };
+ enum { O_HALFHEIGHT, O_HALFWIDTH, O_HEIGHT, O_MARGINS, O_PADDING,
+ O_SYSSIZE, O_WIDTH };
if (objc < 2) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -1158,8 +1158,8 @@ Ttk_CreateVsapiElement(
Tcl_SetErrorCode(interp, "TTK", "VSAPI", "MISSING", NULL);
goto retErr;
}
- if (Tcl_GetIndexFromObjStruct(interp, objv[i], optionStrings,
- sizeof(char *), "option", 0, &option) != TCL_OK)
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings,
+ "option", 0, &option) != TCL_OK)
goto retErr;
switch (option) {
case O_PADDING: