+ if (parent != 0) {
+ p = findGtkTreeItem(parent);
+ 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 {
+ m_anchor = item;
+ gtk_container_add(GTK_CONTAINER(m_tree), GTK_WIDGET(item));
+ }
+
+ if ((info.m_mask & wxTREE_MASK_CHILDREN) != 0) {
+ GtkTree *tree = GTK_TREE(gtk_tree_new());
+ gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), GTK_WIDGET(tree));
+ gtk_widget_show(GTK_WIDGET(tree));
+ }
+
+ 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 info.m_itemId;
+}
+
+long wxTreeCtrl::InsertItem(long parent, const wxString& label, int image,
+ int selImage, long insertAfter) {
+
+ wxTreeItem info;
+ info.m_text = label;
+ info.m_mask = wxTREE_MASK_TEXT;
+ if (image > -1) {
+ info.m_mask |= wxTREE_MASK_IMAGE | wxTREE_MASK_SELECTED_IMAGE;
+ info.m_image = image;
+ if (selImage == -1)
+ info.m_selectedImage = image;
+ else
+ info.m_selectedImage = selImage;
+ }
+
+ return InsertItem(parent, info, insertAfter);
+}
+
+bool wxTreeCtrl::SelectItem(long item)