-wxTreeItem::wxTreeItem(GtkWidget *parent, const wxTreeItem &item) {
- m_mask = item.m_mask;
- m_text = item.m_text;
- m_itemId = item.m_itemId;
- m_state = item.m_state;
- m_stateMask = item.m_stateMask;
- m_image = item.m_image;
- m_tree = NULL;
- m_owner = 0;
- m_selectedImage = item.m_selectedImage;
- m_children = item.m_children;
- m_childlist = item.m_childlist;
- m_data = item.m_data;
- m_parentwidget = parent;
- expand_handler = 0;
- collapse_handler = 0;
-
- Create();
-}
-
-void wxTreeItem::Create() {
- wxASSERT(m_parentwidget != NULL);
-
- m_widget = GTK_TREE_ITEM(gtk_tree_item_new_with_label ((char *)(const char *)m_text));
- gtk_container_add (GTK_CONTAINER(m_parentwidget), GTK_WIDGET(m_widget));
- gtk_widget_show(GTK_WIDGET(m_widget));
-
- ignore = FALSE;
-
- gtk_signal_connect(GTK_OBJECT(m_widget), "select",
- GTK_SIGNAL_FUNC(gtk_treeitem_select_callback), (gpointer)this );
-
- gtk_signal_connect(GTK_OBJECT(m_widget), "deselect",
- GTK_SIGNAL_FUNC(gtk_treeitem_deselect_callback), (gpointer)this );
-
- if (expand_handler == 0)
- expand_handler = gtk_signal_connect(GTK_OBJECT(m_widget), "expand",
- GTK_SIGNAL_FUNC(gtk_treeitem_expand_callback), (gpointer)this );
-
- if (collapse_handler == 0)
- collapse_handler = gtk_signal_connect( GTK_OBJECT(m_widget), "collapse",
- GTK_SIGNAL_FUNC(gtk_treeitem_collapse_callback), (gpointer)this );
-
- if ((m_mask & wxTREE_MASK_CHILDREN) != 0)
- AddSubtree();
-}
-
-wxTreeItem::~wxTreeItem() {
- if (m_owner != NULL)
- SendDelete(m_owner);
- DeleteChildren();
- if ((m_widget != NULL) && (m_parentwidget != NULL))
- gtk_container_remove(GTK_CONTAINER(m_parentwidget),
- GTK_WIDGET(m_widget));
-// if (m_tree != NULL) {
-// gtk_widget_destroy(GTK_WIDGET(m_tree));
-// m_tree = NULL;
-// }
-
-// if (m_widget != NULL)
-// gtk_widget_destroy(GTK_WIDGET(m_widget));
-}
-
-void wxTreeItem::AddSubtree() {
- if (m_widget == NULL)
- return;
+ m_windowStyle = style;
+
+ SetParent(parent);
+
+ if (width <= 0)
+ width = 100;
+ if (height <= 0)
+ height = 30;
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+
+ m_needParent = TRUE;
+
+ PreCreation( parent, id, pos, size, style, name );
+
+ m_widget = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);