+printf("begin insert\n");
+
+ item = GTK_TREE_ITEM(gtk_tree_item_new());
+
+ GtkHBox *m_box = GTK_HBOX(gtk_hbox_new(FALSE, 0));
+ gtk_container_add (GTK_CONTAINER (item), GTK_WIDGET(m_box));
+
+ gtk_object_set_data(GTK_OBJECT(item), "w_box", m_box);
+
+ const wxBitmap *bmp;
+ const wxImageList *list;
+ if ((list = GetImageList(wxIMAGE_LIST_NORMAL)) != NULL)
+ if ((bmp = list->GetBitmap(image)) != NULL)
+ if (bmp->Ok()) {
+ GdkBitmap *mask = NULL;
+ if (bmp->GetMask())
+ mask = bmp->GetMask()->GetBitmap();
+ GtkPixmap *m_image_widget = GTK_PIXMAP(gtk_pixmap_new(bmp->GetPixmap(), mask));
+ gtk_misc_set_alignment (GTK_MISC (m_image_widget), 0.0, 0.5);
+ gtk_box_pack_start(GTK_BOX(m_box), GTK_WIDGET(m_image_widget), FALSE, FALSE, 0);
+ gtk_object_set_data(GTK_OBJECT(item), "w_image", (void *)m_image_widget);
+ gtk_object_set_data(GTK_OBJECT(item), "image", (void *)image);
+ gtk_widget_show (GTK_WIDGET(m_image_widget));
+ }
+ GtkLabel *m_label_widget = GTK_LABEL(gtk_label_new ((char *)(const char *)text));
+ gtk_misc_set_alignment (GTK_MISC (m_label_widget), 0.5, 0.5);
+ gtk_box_pack_start(GTK_BOX(m_box), GTK_WIDGET(m_label_widget), FALSE, FALSE, 0);
+ gtk_object_set_data(GTK_OBJECT(item), "w_label", m_label_widget);
+ gtk_widget_show (GTK_WIDGET(m_label_widget));
+
+ gtk_widget_show(GTK_WIDGET(m_box));
+
+ gtk_object_set_data(GTK_OBJECT(item), "owner", this);
+ gtk_object_set_data(GTK_OBJECT(item), "data", data);
+ gtk_object_set_data(GTK_OBJECT(item), "parent", p);
+
+ if (p != 0) {
+ if (p->subtree == NULL) {
+ GtkTree *tree = GTK_TREE(gtk_tree_new());
+ gtk_tree_item_set_subtree(GTK_TREE_ITEM(p), GTK_WIDGET(tree));
+ gtk_widget_show(GTK_WIDGET(tree));
+ p->expanded = 1;
+ }
+
+ gtk_container_add(GTK_CONTAINER(p->subtree), GTK_WIDGET(item));
+ } else {
+printf("Adding root\n");
+printf("m_tree = %p\n", m_tree);
+ m_anchor = item;
+ gtk_container_add(GTK_CONTAINER(m_tree), GTK_WIDGET(item));
+ }
+
+ gtk_widget_show(GTK_WIDGET(item));
+
+ gtk_signal_connect(GTK_OBJECT(item), "select",
+ GTK_SIGNAL_FUNC(gtk_treeitem_select_callback), (gpointer)this );
+
+ gtk_signal_connect(GTK_OBJECT(item), "deselect",
+ GTK_SIGNAL_FUNC(gtk_treeitem_select_callback), (gpointer)this );
+
+ gtk_signal_connect(GTK_OBJECT(item), "expand",
+ GTK_SIGNAL_FUNC(gtk_treeitem_expand_callback), (gpointer)this );
+ gtk_signal_connect(GTK_OBJECT(item), "collapse",
+ GTK_SIGNAL_FUNC(gtk_treeitem_collapse_callback), (gpointer)this );
+
+ return item;