/* Removes the items at positions between start and end from the GtkTree tree. * Removing an item from a GtkTree dereferences the item, and thus usually * destroys the item and any subtrees it may contain. If the item is not * to be destroyed, use gtk_object_ref() before removing it. */ int clip_GTK_TREECLEARITEMS(ClipMachine * cm) { C_widget *ctree = _fetch_cw_arg(cm); gint start = INT_OPTION(cm,2,1)-1; gint end = INT_OPTION(cm,3,1)-1; CHECKCWID(ctree,GTK_IS_TREE); CHECKOPT(2,NUMERIC_t); CHECKOPT(3,NUMERIC_t); gtk_tree_clear_items(GTK_TREE(ctree->widget), start, end); return 0; err: return 1; }
/*** sfeRebuildUI - take the structure file data and completely rebuild the *** user interface representation, including the treeview navigation. ***/ int sfeRebuildUI(pStructInf new_data, GtkTree *treeview) { GtkWidget *treeitem, *subtree; /** Clear any existing treeview content. **/ gtk_tree_clear_items(treeview, 0, 9999); /** Add a root item **/ treeitem = sfeBuildTreeItemWithImage(new_data); gtk_tree_prepend(treeview, treeitem); gtk_widget_show(treeitem); /** Build the tree, recursively. **/ sfeRebuildUI_r(new_data, GTK_TREE_ITEM(treeitem)); /** Expand the root node **/ gtk_tree_item_expand(GTK_TREE_ITEM(treeitem)); return 0; }