const wxValidator& validator = wxDefaultValidator );
virtual bool AssociateModel( wxDataViewListModel *model );
- virtual bool AppendColumn( wxDataViewColumn *col );
+ virtual bool AppendColumn( wxDataViewColumn *col );
+
+private:
+ friend class wxDataViewCtrlDC;
+ GtkWidget *m_treeview;
private:
DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
if (n == -1)
return FALSE;
- if (n >= (int) list_store->model->GetNumberOfRows())
+ if (n >= (int) list_store->model->GetNumberOfRows()-1)
return FALSE;
iter->user_data = (gpointer) ++n;
public:
wxDataViewCtrlDC( wxDataViewCtrl *window )
{
- GtkWidget *widget = window->GetHandle();
+ GtkWidget *widget = window->m_treeview;
// Set later
m_window = NULL;
wxFAIL_MSG( wxT("wxDataViewCtrl creation failed") );
return FALSE;
}
+
+ m_widget = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (m_widget), GTK_SHADOW_IN);
+
+ m_treeview = gtk_tree_view_new();
+ gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
- m_widget = gtk_tree_view_new();
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+ gtk_widget_show (m_treeview);
m_parent->DoAddChild( this );
model->SetNotifier( notifier );
- gtk_tree_view_set_model( GTK_TREE_VIEW(m_widget), GTK_TREE_MODEL(gtk_store) );
+ gtk_tree_view_set_model( GTK_TREE_VIEW(m_treeview), GTK_TREE_MODEL(gtk_store) );
+ g_object_unref( gtk_store );
return true;
}
GtkTreeViewColumn *column = (GtkTreeViewColumn *)col->GetGtkHandle();
- gtk_tree_view_append_column( GTK_TREE_VIEW(m_widget), column );
+ gtk_tree_view_append_column( GTK_TREE_VIEW(m_treeview), column );
return true;
}