Beispiel #1
0
/* Recursively apply a function to all nodes of the tree at or below a
 * certain node. The function is called for each node after it has
 * been called for its parent. */
int
clip_GTK_CTREEPRERECURSIVE(ClipMachine * cm)
{
	C_widget   *cctree = _fetch_cw_arg(cm);
	C_object    *cnode = _fetch_cobject(cm,_clip_spar(cm,2));
	ClipVar     *cfunc = _clip_spar(cm,3);
	Ctree_var c;
	CHECKCWID(cctree,GTK_IS_CTREE);
	CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE);
	CHECKARG2(3,CCODE_t,PCODE_t);
	c.cm = cm; c.cv = cfunc; c.cw = cctree; c.cfunc = cfunc;
	gtk_ctree_pre_recursive(GTK_CTREE(cctree->widget),GTK_CTREE_NODE(cnode->object),
		(GtkCTreeFunc)_ctree_func,&c);
	return 0;
err:
	return 1;
}
Beispiel #2
0
/*
 * Row selection callback.
 * Recursively change the style of all nodes.
 */
static void
gdisp_treeSelectRowCallback(GtkCTree     *cTree,
			    GtkCTreeNode *cNode,
			    gint          column,
			    gpointer      data)
{

  Kernel_T *kernel = (Kernel_T*)data;

  /*
   * Recursively change the style of all sub-nodes.
   */
  gtk_ctree_pre_recursive(cTree,
			  cNode,
			  gdisp_changeNodeStyle,
			  (gpointer)kernel->widgets.selectedNodeStyle);

}