summaryrefslogtreecommitdiffstats
path: root/generic/tkTreeStyle.c
diff options
context:
space:
mode:
authortreectrl <treectrl>2004-08-13 20:28:53 (GMT)
committertreectrl <treectrl>2004-08-13 20:28:53 (GMT)
commitec4a4cdd3f5507f9006f669f6f72f1c87bb7a087 (patch)
treeca6f4faffccf7f13a061e77e79e9815a0859fb77 /generic/tkTreeStyle.c
parent2ad7ea36646eb5d9e6ae9e3b51f4b6ec1f23773c (diff)
downloadtktreectrl-ec4a4cdd3f5507f9006f669f6f72f1c87bb7a087.zip
tktreectrl-ec4a4cdd3f5507f9006f669f6f72f1c87bb7a087.tar.gz
tktreectrl-ec4a4cdd3f5507f9006f669f6f72f1c87bb7a087.tar.bz2
Add TreeItem argument to element create proc so element can call Tree_RedrawElement().
Diffstat (limited to 'generic/tkTreeStyle.c')
-rw-r--r--generic/tkTreeStyle.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/generic/tkTreeStyle.c b/generic/tkTreeStyle.c
index 0e4abfe..3389a64 100644
--- a/generic/tkTreeStyle.c
+++ b/generic/tkTreeStyle.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 2002-2004 Tim Baker
*
- * RCS: @(#) $Id: tkTreeStyle.c,v 1.15 2004/08/09 02:25:35 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeStyle.c,v 1.16 2004/08/13 20:28:53 treectrl Exp $
*/
#include "tkTreeCtrl.h"
@@ -1760,7 +1760,7 @@ int TreeStyle_FindElement(TreeCtrl *tree, TreeStyle style_, TreeElement elem_, i
}
/* Create an instance Element if it doesn't exist in this Style */
-static ElementLink *Style_CreateElem(TreeCtrl *tree, Style *style, Element *masterElem, int *isNew)
+static ElementLink *Style_CreateElem(TreeCtrl *tree, TreeItem item, Style *style, Element *masterElem, int *isNew)
{
ElementLink *eLink = NULL;
Element *elem;
@@ -1801,6 +1801,7 @@ static ElementLink *Style_CreateElem(TreeCtrl *tree, Style *style, Element *mast
elem->name = masterElem->name;
elem->master = masterElem;
args.tree = tree;
+ args.item = item;
args.elem = elem;
/* FIXME: free memory if these calls could actually fail */
@@ -2210,7 +2211,7 @@ Tcl_Obj *TreeStyle_GetText(TreeCtrl *tree, TreeStyle style_)
return NULL;
}
-void TreeStyle_SetText(TreeCtrl *tree, TreeStyle style_, Tcl_Obj *textObj)
+void TreeStyle_SetText(TreeCtrl *tree, TreeItem item, TreeStyle style_, Tcl_Obj *textObj)
{
Style *style = (Style *) style_;
Style *masterStyle = style->master;
@@ -2234,7 +2235,7 @@ void TreeStyle_SetText(TreeCtrl *tree, TreeStyle style_, Tcl_Obj *textObj)
Tcl_Obj *objv[2];
ElementArgs args;
- eLink = Style_CreateElem(tree, style, eLink->elem, NULL);
+ eLink = Style_CreateElem(tree, item, style, eLink->elem, NULL);
objv[0] = confTextObj;
objv[1] = textObj;
args.tree = tree;
@@ -2379,6 +2380,20 @@ static void Element_Deleted(TreeCtrl *tree, Element *masterElem)
}
}
+void Tree_RedrawElement(TreeCtrl *tree, TreeItem item, Element *elem)
+{
+ /* Master element */
+ if (elem->master == NULL)
+ {
+ }
+
+ /* Instance element */
+ else
+ {
+ Tree_InvalidateItemDInfo(tree, item, NULL);
+ }
+}
+
void TreeStyle_TreeChanged(TreeCtrl *tree, int flagT)
{
Tcl_HashEntry *hPtr;
@@ -2434,7 +2449,7 @@ int TreeStyle_ElementCget(TreeCtrl *tree, TreeStyle style_, Tcl_Obj *elemObj, Tc
return TCL_OK;
}
-int TreeStyle_ElementConfigure(TreeCtrl *tree, TreeStyle style_, Tcl_Obj *elemObj, int objc, Tcl_Obj **objv, int *eMask)
+int TreeStyle_ElementConfigure(TreeCtrl *tree, TreeItem item, TreeStyle style_, Tcl_Obj *elemObj, int objc, Tcl_Obj **objv, int *eMask)
{
Style *style = (Style *) style_;
Element *elem;
@@ -2472,7 +2487,7 @@ int TreeStyle_ElementConfigure(TreeCtrl *tree, TreeStyle style_, Tcl_Obj *elemOb
{
int isNew;
- eLink = Style_CreateElem(tree, style, elem, &isNew);
+ eLink = Style_CreateElem(tree, item, style, elem, &isNew);
if (eLink == NULL)
{
FormatResult(tree->interp, "style %s does not use element %s",
@@ -2547,6 +2562,7 @@ static Element *Element_CreateAndConfig(TreeCtrl *tree, ElementType *type, char
elem->name = Tk_GetUid(name);
elem->typePtr = type;
args.tree = tree;
+ args.item = NULL;
args.elem = elem;
if ((*type->createProc)(&args) != TCL_OK)
return NULL;