Exemple #1
0
/*
 * Popup Menu Handler.
 * Expand or Collapse the whole hierarchical tree.
 */
static void
gdisp_popupMenuHandler ( Kernel_T    *kernel,
			 PopupMenu_T *menu,
			 gpointer     menuData, /* cTree */
			 gpointer     itemData )
{

  GtkWidget *cTree  = (GtkWidget*)menuData;
  guint      action = GPOINTER_TO_UINT(itemData);

  /*
   * itemData : 0-collapse, 1-expand
   */
  if (action == 1 /* expand */) {

    gtk_ctree_expand_recursive(GTK_CTREE(cTree),
			       (GtkCTreeNode*)NULL);

  }
  else {

    gtk_ctree_collapse_recursive(GTK_CTREE(cTree),
				 (GtkCTreeNode*)NULL);

  }

}
Exemple #2
0
/* Expand one node and all nodes underneath. */
int
clip_GTK_CTREEEXPANDRECURSIVE(ClipMachine * cm)
{
	C_widget   *cctree = _fetch_cw_arg(cm);
	C_object    *cnode = _fetch_cobject(cm,_clip_spar(cm,2));
	CHECKCWID(cctree,GTK_IS_CTREE);
	CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE);
	gtk_ctree_expand_recursive(GTK_CTREE(cctree->widget),
			GTK_CTREE_NODE(cnode->object));
	return 0;
err:
	return 1;
}
Exemple #3
0
/* Recursively expands the entire directory tree subtree of the given
 * directory */
void
dirtree_entry_expand_recursive( GNode *dnode )
{
	g_assert( NODE_IS_DIR(dnode) );

#if DEBUG
	/* Guard against expansions inside collapsed subtrees */
	/** NOTE: This function may be upgraded to behave similarly to
	 ** dirtree_entry_expand( ) w.r.t. collapsed parent directories.
	 ** This has been avoided thus far since such a behavior would
	 ** not be used by the program. */
	if (NODE_IS_DIR(dnode->parent))
		g_assert( dirtree_entry_expanded( dnode->parent ) );
#endif

	block_colexp_handlers( );
	gtk_ctree_expand_recursive( GTK_CTREE(dir_ctree_w), DIR_NODE_DESC(dnode)->ctnode );
	unblock_colexp_handlers( );
}