src/gtk/iupgtk_tree.c
static void gtkTreeCopyItem(Ihandle* ih, GtkTreeModel* model, GtkTreeIter* iterItem, GtkTreeIter* iterParent, int position, GtkTreeIter *iterNewItem)
{
  GtkTreeStore* store = GTK_TREE_STORE(model);
  int kind;
  char* title;
  gboolean has_image, has_image_expanded;
  PangoFontDescription* font;
  GdkColor *color;
  GdkPixbuf* image, *image_expanded;

  gtk_tree_model_get(GTK_TREE_MODEL(store), iterItem, IUPGTK_NODE_IMAGE,      &image,
                                                      IUPGTK_NODE_HAS_IMAGE,      &has_image,
                                                      IUPGTK_NODE_IMAGE_EXPANDED,  &image_expanded,
                                                      IUPGTK_NODE_HAS_IMAGE_EXPANDED,  &has_image_expanded,
                                                      IUPGTK_NODE_TITLE,  &title,
                                                      IUPGTK_NODE_KIND,  &kind,
                                                      IUPGTK_NODE_COLOR, &color, 
                                                      IUPGTK_NODE_FONT, &font, 
                                                      -1);

  /* Add the new node */
  ih->data->node_count++;
  if (position == 2)
    gtk_tree_store_append(store, iterNewItem, iterParent);
  else if (position == 1)                                      /* copy as first child of expanded branch */
    gtk_tree_store_insert(store, iterNewItem, iterParent, 0);  /* iterParent is parent of the new item (firstchild of it) */
  else                                                                  /* copy as next brother of item or collapsed branch */
    gtk_tree_store_insert_after(store, iterNewItem, NULL, iterParent);  /* iterParent is sibling of the new item */

  gtk_tree_store_set(store, iterNewItem,  IUPGTK_NODE_IMAGE,      image,
                                          IUPGTK_NODE_HAS_IMAGE,  has_image,
                                          IUPGTK_NODE_IMAGE_EXPANDED,  image_expanded,
                                          IUPGTK_NODE_HAS_IMAGE_EXPANDED, has_image_expanded,
                                          IUPGTK_NODE_TITLE,  title,
                                          IUPGTK_NODE_KIND,  kind,
                                          IUPGTK_NODE_COLOR, color, 
                                          IUPGTK_NODE_FONT, font,
                                          IUPGTK_NODE_SELECTED, 0,
                                          IUPGTK_NODE_CHECK, 0,
                                          IUPGTK_NODE_3STATE, 0,
                                          IUPGTK_NODE_TOGGLEVISIBLE, 1,
                                          -1);
}
/*****************************************************************************/
/* COPYING ITEMS (Branches and its children)                                 */
/*****************************************************************************/
/* Insert the copied item in a new location. Returns the new item. */
COPYING ITEMS (Branches and its children)
Insert the copied item in a new location. Returns the new item.
COPYING ITEMS ( Branches and its children ) Insert the copied item in a new location . Returns the new item .
static void gtkTreeCopyItem(Ihandle* ih, GtkTreeModel* model, GtkTreeIter* iterItem, GtkTreeIter* iterParent, int position, GtkTreeIter *iterNewItem)
{
  GtkTreeStore* store = GTK_TREE_STORE(model);
  int kind;
  char* title;
  gboolean has_image, has_image_expanded;
  PangoFontDescription* font;
  GdkColor *color;
  GdkPixbuf* image, *image_expanded;
  gtk_tree_model_get(GTK_TREE_MODEL(store), iterItem, IUPGTK_NODE_IMAGE,      &image,
                                                      IUPGTK_NODE_HAS_IMAGE,      &has_image,
                                                      IUPGTK_NODE_IMAGE_EXPANDED,  &image_expanded,
                                                      IUPGTK_NODE_HAS_IMAGE_EXPANDED,  &has_image_expanded,
                                                      IUPGTK_NODE_TITLE,  &title,
                                                      IUPGTK_NODE_KIND,  &kind,
                                                      IUPGTK_NODE_COLOR, &color, 
                                                      IUPGTK_NODE_FONT, &font, 
                                                      -1);
  ih->data->node_count++;
  if (position == 2)
    gtk_tree_store_append(store, iterNewItem, iterParent);
  else if (position == 1)                                      
    gtk_tree_store_insert(store, iterNewItem, iterParent, 0);  
  else                                                                  
    gtk_tree_store_insert_after(store, iterNewItem, NULL, iterParent);  
  gtk_tree_store_set(store, iterNewItem,  IUPGTK_NODE_IMAGE,      image,
                                          IUPGTK_NODE_HAS_IMAGE,  has_image,
                                          IUPGTK_NODE_IMAGE_EXPANDED,  image_expanded,
                                          IUPGTK_NODE_HAS_IMAGE_EXPANDED, has_image_expanded,
                                          IUPGTK_NODE_TITLE,  title,
                                          IUPGTK_NODE_KIND,  kind,
                                          IUPGTK_NODE_COLOR, color, 
                                          IUPGTK_NODE_FONT, font,
                                          IUPGTK_NODE_SELECTED, 0,
                                          IUPGTK_NODE_CHECK, 0,
                                          IUPGTK_NODE_3STATE, 0,
                                          IUPGTK_NODE_TOGGLEVISIBLE, 1,
                                          -1);
}
static void gtkTreeCopyItem ( Ihandle * ih , GtkTreeModel * model , GtkTreeIter * iterItem , GtkTreeIter * iterParent , int position , GtkTreeIter * iterNewItem ) { GtkTreeStore * store = GTK_TREE_STORE ( model ) ; int kind ; char * title ; gboolean has_image , has_image_expanded ; PangoFontDescription * font ; GdkColor * color ; GdkPixbuf * image , * image_expanded ; gtk_tree_model_get ( GTK_TREE_MODEL ( store ) , iterItem , IUPGTK_NODE_IMAGE , & image , IUPGTK_NODE_HAS_IMAGE , & has_image , IUPGTK_NODE_IMAGE_EXPANDED , & image_expanded , IUPGTK_NODE_HAS_IMAGE_EXPANDED , & has_image_expanded , IUPGTK_NODE_TITLE , & title , IUPGTK_NODE_KIND , & kind , IUPGTK_NODE_COLOR , & color , IUPGTK_NODE_FONT , & font , -1 ) ; ih -> data -> node_count ++ ; if ( position == 2 ) gtk_tree_store_append ( store , iterNewItem , iterParent ) ; else if ( position == 1 ) gtk_tree_store_insert ( store , iterNewItem , iterParent , 0 ) ; else gtk_tree_store_insert_after ( store , iterNewItem , NULL , iterParent ) ; gtk_tree_store_set ( store , iterNewItem , IUPGTK_NODE_IMAGE , image , IUPGTK_NODE_HAS_IMAGE , has_image , IUPGTK_NODE_IMAGE_EXPANDED , image_expanded , IUPGTK_NODE_HAS_IMAGE_EXPANDED , has_image_expanded , IUPGTK_NODE_TITLE , title , IUPGTK_NODE_KIND , kind , IUPGTK_NODE_COLOR , color , IUPGTK_NODE_FONT , font , IUPGTK_NODE_SELECTED , 0 , IUPGTK_NODE_CHECK , 0 , IUPGTK_NODE_3STATE , 0 , IUPGTK_NODE_TOGGLEVISIBLE , 1 , -1 ) ; }
COPYING ITEMS (Branches and its children)
Insert the copied item in a new location.
COPYING ITEMS ( Branches and its children ) Insert the copied item in a new location .
/* Add the new node */ /* copy as first child of expanded branch */ /* iterParent is parent of the new item (firstchild of it) */ /* copy as next brother of item or collapsed branch */ /* iterParent is sibling of the new item */