From ab8f482b2143943ff8d33bd1b6f986e7636d0056 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 11 Jun 2000 05:07:13 +0000 Subject: supply the pixbufs here. 2000-06-10 Chris Toshok * e-tree-example-1.c (create_tree): supply the pixbufs here. * e-cell-tree.h: change pixbuf names to open_pixbuf/closed_pixbuf. * e-cell-tree.c (e_cell_tree_construct): take open/closed pixbuf parameters, and don't #include the .xpm files directly here. (e_cell_tree_new): same. (ect_draw): use the pixbufs from the ECellTree. svn path=/trunk/; revision=3522 --- widgets/table/e-tree-example-1.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'widgets/table/e-tree-example-1.c') diff --git a/widgets/table/e-tree-example-1.c b/widgets/table/e-tree-example-1.c index c598e33ea4..e2ba566a99 100644 --- a/widgets/table/e-tree-example-1.c +++ b/widgets/table/e-tree-example-1.c @@ -15,7 +15,10 @@ #include -#define ROWS 10 +#include "tree-expanded.xpm" +#include "tree-unexpanded.xpm" + + #define COLS 4 #define IMPORTANCE_COLUMN 4 @@ -218,6 +221,7 @@ static void create_tree (void) { GtkWidget *window, *frame, *button, *vbox; + GdkPixbuf *tree_expanded_pixbuf, *tree_unexpanded_pixbuf; ECell *cell_left_just; ECell *cell_tree; ETableHeader *e_table_header; @@ -265,13 +269,21 @@ create_tree (void) * each column. */ cell_left_just = e_cell_text_new (E_TABLE_MODEL(e_tree_model), NULL, GTK_JUSTIFY_LEFT); + + /* + * Create our pixbuf for expanding/unexpanding + */ + tree_expanded_pixbuf = gdk_pixbuf_new_from_xpm_data(tree_expanded_xpm); + tree_unexpanded_pixbuf = gdk_pixbuf_new_from_xpm_data(tree_unexpanded_xpm); /* * This renderer is used for the tree column (the leftmost one), and * has as its subcell renderer the text renderer. this means that * text is displayed to the right of the tree pipes. */ - cell_tree = e_cell_tree_new (E_TABLE_MODEL(e_tree_model), TRUE, cell_left_just); + cell_tree = e_cell_tree_new (E_TABLE_MODEL(e_tree_model), + tree_expanded_pixbuf, tree_unexpanded_pixbuf, + TRUE, cell_left_just); /* * Next we create a column object for each view column and add -- cgit v1.2.3