summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkTheme.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-12-12 01:42:10 (GMT)
committerjenglish <jenglish@flightlab.com>2007-12-12 01:42:10 (GMT)
commit37862b3d4ef123216cff4f026b24df258619f0c7 (patch)
tree7c1b183d200e4599cad30e6c8f7e71eca5ae9a6c /generic/ttk/ttkTheme.c
parent52875fedbaf361884d806f4c695114bb457a5f6f (diff)
downloadtk-37862b3d4ef123216cff4f026b24df258619f0c7.zip
tk-37862b3d4ef123216cff4f026b24df258619f0c7.tar.gz
tk-37862b3d4ef123216cff4f026b24df258619f0c7.tar.bz2
* generic/ttk/ttkTheme.c(StyleElementOptionsCmd):
Use Ttk_GetElement() to find element instead of direct hash table access.
Diffstat (limited to 'generic/ttk/ttkTheme.c')
-rw-r--r--generic/ttk/ttkTheme.c18
1 files changed, 9 insertions, 9 deletions
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;
}