diff options
-rw-r--r-- | widgets/e-table/ChangeLog | 8 | ||||
-rw-r--r-- | widgets/e-table/e-tree-example-1.c | 10 | ||||
-rw-r--r-- | widgets/table/e-tree-example-1.c | 10 |
3 files changed, 20 insertions, 8 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 2b87799b03..a3a2977668 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,11 @@ +2000-08-31 Richard Hult <rhult@codefactory.se> + + * e-tree-example-1.c (create_tree): Don't show the root node. + Also quit when the window is closed. + (my_icon_at): Don't use icons here since the cell tree renderer takes + care of the +/- signs itself. This stops the tree example from showing + two sets of expand/unexpand icons at every node. + 2000-08-28 Christopher James Lahey <clahey@helixcode.com> * e-table-group-container.c: Make printing of groups work better diff --git a/widgets/e-table/e-tree-example-1.c b/widgets/e-table/e-tree-example-1.c index 3762dc6b39..71b3f7ca5d 100644 --- a/widgets/e-table/e-tree-example-1.c +++ b/widgets/e-table/e-tree-example-1.c @@ -86,10 +86,8 @@ my_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data) static GdkPixbuf * my_icon_at (ETreeModel *etm, ETreePath *path, void *model_data) { - if (e_tree_model_node_is_expanded (etm, path)) - return tree_expanded_pixbuf; - else - return tree_unexpanded_pixbuf; + /* No icon, since the cell tree renderer takes care of the +/- icons itself. */ + return NULL; } /* This function sets the value at a particular point in our ETreeModel. */ @@ -254,6 +252,8 @@ create_tree (void) 0, g_strdup("Root Node")); + e_tree_model_root_node_set_visible (e_tree_model, FALSE); + for (i = 0; i < 5; i++){ ETreePath *n = e_tree_model_node_insert (e_tree_model, root_node, 0, @@ -369,6 +369,8 @@ create_tree (void) /* Size the initial window. */ gtk_widget_set_usize (window, 200, 200); + gtk_signal_connect (GTK_OBJECT (window), "delete-event", gtk_main_quit, NULL); + /* Show it all. */ gtk_widget_show_all (window); } diff --git a/widgets/table/e-tree-example-1.c b/widgets/table/e-tree-example-1.c index 3762dc6b39..71b3f7ca5d 100644 --- a/widgets/table/e-tree-example-1.c +++ b/widgets/table/e-tree-example-1.c @@ -86,10 +86,8 @@ my_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data) static GdkPixbuf * my_icon_at (ETreeModel *etm, ETreePath *path, void *model_data) { - if (e_tree_model_node_is_expanded (etm, path)) - return tree_expanded_pixbuf; - else - return tree_unexpanded_pixbuf; + /* No icon, since the cell tree renderer takes care of the +/- icons itself. */ + return NULL; } /* This function sets the value at a particular point in our ETreeModel. */ @@ -254,6 +252,8 @@ create_tree (void) 0, g_strdup("Root Node")); + e_tree_model_root_node_set_visible (e_tree_model, FALSE); + for (i = 0; i < 5; i++){ ETreePath *n = e_tree_model_node_insert (e_tree_model, root_node, 0, @@ -369,6 +369,8 @@ create_tree (void) /* Size the initial window. */ gtk_widget_set_usize (window, 200, 200); + gtk_signal_connect (GTK_OBJECT (window), "delete-event", gtk_main_quit, NULL); + /* Show it all. */ gtk_widget_show_all (window); } |