aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-model.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-06-23 15:19:11 +0800
committerChris Toshok <toshok@src.gnome.org>2000-06-23 15:19:11 +0800
commit29a313c41efa7844952000a88d772af11fbb6f37 (patch)
treec0d0837717182506a660c444cc9f2161548fe579 /widgets/table/e-tree-model.c
parent642d8b228a1e2207b921dc22508e9ffed888b877 (diff)
downloadgsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.tar
gsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.tar.gz
gsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.tar.bz2
gsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.tar.lz
gsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.tar.xz
gsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.tar.zst
gsoc2013-evolution-29a313c41efa7844952000a88d772af11fbb6f37.zip
use the expanded/unexpanded pixbufs as node pixbufs for the first level of
2000-06-23 Chris Toshok <toshok@helixcode.com> * e-tree-example-1.c (create_tree): use the expanded/unexpanded pixbufs as node pixbufs for the first level of children, to test the drawing. * e-tree-model.c (e_tree_model_node_get_closed_pixbuf): new function. (e_tree_model_node_get_opened_pixbuf): same. (e_tree_model_node_insert): add opened/closed pixbuf argument. (e_tree_model_node_insert_before): same. * e-tree-model.h: add prototypes for opened/closed pixbuf accessors, and add them to the e_tree_model_node_insert_* calls. * e-cell-tree.c (ect_draw): add opened/closed pixbuf drawing per node. svn path=/trunk/; revision=3706
Diffstat (limited to 'widgets/table/e-tree-model.c')
-rw-r--r--widgets/table/e-tree-model.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index 180c63bb96..47b82d3689 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -23,6 +23,8 @@ static ETableModel *e_tree_model_parent_class;
typedef struct {
gboolean expanded;
guint visible_descendents;
+ GdkPixbuf *opened_pixbuf;
+ GdkPixbuf *closed_pixbuf;
gpointer node_data;
} ENode;
@@ -552,10 +554,36 @@ e_tree_model_node_set_data (ETreeModel *etm, ETreePath *node, gpointer node_data
enode->node_data = node_data;
}
+GdkPixbuf *
+e_tree_model_node_get_opened_pixbuf (ETreeModel *etm, ETreePath *node)
+{
+ ENode *enode;
+
+ g_return_val_if_fail (node && node->data, NULL);
+
+ enode = (ENode*)node->data;
+
+ return enode->opened_pixbuf;
+}
+
+GdkPixbuf *
+e_tree_model_node_get_closed_pixbuf (ETreeModel *etm, ETreePath *node)
+{
+ ENode *enode;
+
+ g_return_val_if_fail (node && node->data, NULL);
+
+ enode = (ENode*)node->data;
+
+ return enode->closed_pixbuf;
+}
+
ETreePath*
e_tree_model_node_insert (ETreeModel *tree_model,
ETreePath *parent_path,
int position,
+ GdkPixbuf *opened_pixbuf,
+ GdkPixbuf *closed_pixbuf,
gpointer node_data)
{
ENode *node;
@@ -566,6 +594,8 @@ e_tree_model_node_insert (ETreeModel *tree_model,
node = g_new0 (ENode, 1);
node->expanded = FALSE;
+ node->closed_pixbuf = closed_pixbuf;
+ node->opened_pixbuf = opened_pixbuf;
node->node_data = node_data;
if (parent_path != NULL) {
@@ -608,11 +638,16 @@ e_tree_model_node_insert (ETreeModel *tree_model,
}
ETreePath *
-e_tree_model_node_insert_before (ETreeModel *etree, ETreePath *parent,
- ETreePath *sibling, gpointer node_data)
+e_tree_model_node_insert_before (ETreeModel *etree,
+ ETreePath *parent,
+ ETreePath *sibling,
+ GdkPixbuf *opened_pixbuf,
+ GdkPixbuf *closed_pixbuf,
+ gpointer node_data)
{
return e_tree_model_node_insert (etree, parent,
g_node_child_position (parent, sibling),
+ opened_pixbuf, closed_pixbuf,
node_data);
}