示例#1
0
/* GetOptionMap --
 * 	Return a cached OptionMap matching the specified optionTable
 * 	for the specified element, creating it if necessary.
 */
static OptionMap
GetOptionMap(ElementImpl *elementImpl, Tk_OptionTable optionTable)
{
    OptionMap optionMap;
    int isNew;
    Tcl_HashEntry *entryPtr = Tcl_CreateHashEntry(
	&elementImpl->optMapCache, (ClientData)optionTable, &isNew);

    if (isNew) {
	optionMap = BuildOptionMap(elementImpl, optionTable);
	Tcl_SetHashValue(entryPtr, optionMap);
    } else {
	optionMap = (OptionMap)(Tcl_GetHashValue(entryPtr));
    }

    return optionMap;
}
示例#2
0
文件: ttkTheme.c 项目: afmayer/tcl-tk
/* GetOptionMap --
 * 	Return a cached OptionMap matching the specified optionTable
 * 	for the specified element, creating it if necessary.
 */
static OptionMap
GetOptionMap(Ttk_ElementClass *elementClass, Tk_OptionTable optionTable)
{
    OptionMap optionMap;
    int isNew;
    Tcl_HashEntry *entryPtr = Tcl_CreateHashEntry(
	&elementClass->optMapCache, (void*)optionTable, &isNew);

    if (isNew) {
	optionMap = BuildOptionMap(elementClass, optionTable);
	Tcl_SetHashValue(entryPtr, optionMap);
    } else {
	optionMap = Tcl_GetHashValue(entryPtr);
    }

    return optionMap;
}