summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/ttk/ttkTheme.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a89d0c..70f9372 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-11 Joe English <jenglish@users.sourceforge.net>
+ * generic/ttk/ttkTheme.c(StyleElementOptionsCmd):
+ Use Ttk_GetElement() to find element instead of direct
+ hash table access.
+
2007-12-11 Donal K. Fellows <dkf@users.sf.net>
* generic/tkText.c (TextReplaceCmd): Added code to rebuild the from
diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c
index 3099f18..572be42 100644
--- a/generic/ttk/ttkTheme.c
+++ b/generic/ttk/ttkTheme.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * $Id: ttkTheme.c,v 1.9 2007/12/02 04:32:23 jenglish Exp $
+ * $Id: ttkTheme.c,v 1.10 2007/12/12 01:42:11 jenglish Exp $
*/
#include <stdlib.h>
@@ -1497,22 +1497,24 @@ static int StyleElementNamesCmd(
}
/* + style element options $element --
+ * Return list of element options for specified element
*/
static int StyleElementOptionsCmd(
ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[])
{
- StylePackageData *pkgPtr = (StylePackageData *)clientData;
+ StylePackageData *pkgPtr = clientData;
Ttk_Theme theme = pkgPtr->currentTheme;
- Tcl_HashEntry *entryPtr;
+ const char *elementName;
+ ElementImpl *elementImpl;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 3, objv, "element");
return TCL_ERROR;
}
- entryPtr = Tcl_FindHashEntry(&theme->elementTable, Tcl_GetString(objv[3]));
- if (entryPtr) {
- ElementImpl *elementImpl = (ElementImpl *)Tcl_GetHashValue(entryPtr);
+ elementName = Tcl_GetString(objv[3]);
+ elementImpl = Ttk_GetElement(theme, elementName);
+ if (elementImpl) {
Ttk_ElementSpec *specPtr = elementImpl->specPtr;
Ttk_ElementOptionSpec *option = specPtr->options;
Tcl_Obj *result = Tcl_NewListObj(0,0);
@@ -1527,9 +1529,7 @@ static int StyleElementOptionsCmd(
return TCL_OK;
}
- Tcl_AppendResult(interp,
- "element ", Tcl_GetString(objv[3]), " not found",
- NULL);
+ Tcl_AppendResult(interp, "element ", elementName, " not found", NULL);
return TCL_ERROR;
}