+
+ gtk_tree_view_column_set_widget( column, NULL );
+}
+
+void wxDataViewColumn::SetBitmap( const wxBitmap &bitmap )
+{
+ wxDataViewColumnBase::SetBitmap( bitmap );
+
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+ if (bitmap.Ok())
+ {
+ GtkImage *gtk_image = GTK_IMAGE( gtk_image_new() );
+
+ GdkBitmap *mask = (GdkBitmap *) NULL;
+ if (bitmap.GetMask())
+ mask = bitmap.GetMask()->GetBitmap();
+
+ if (bitmap.HasPixbuf())
+ {
+ gtk_image_set_from_pixbuf(GTK_IMAGE(gtk_image),
+ bitmap.GetPixbuf());
+ }
+ else
+ {
+ gtk_image_set_from_pixmap(GTK_IMAGE(gtk_image),
+ bitmap.GetPixmap(), mask);
+ }
+ gtk_widget_show( GTK_WIDGET(gtk_image) );
+
+ gtk_tree_view_column_set_widget( column, GTK_WIDGET(gtk_image) );
+ }
+ else
+ {
+ gtk_tree_view_column_set_widget( column, NULL );
+ }
+}
+
+void wxDataViewColumn::SetAlignment( wxAlignment align )
+{
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+
+ gfloat xalign = 0.0;
+ if (align == wxALIGN_RIGHT)
+ xalign = 1.0;
+ if (align == wxALIGN_CENTER)
+ xalign = 0.5;
+
+ gtk_tree_view_column_set_alignment( column, xalign );
+}
+
+void wxDataViewColumn::SetSortable( bool sortable )
+{
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+ gtk_tree_view_column_set_sort_indicator( column, sortable );
+}
+
+bool wxDataViewColumn::GetSortable()
+{
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+ return gtk_tree_view_column_get_sort_indicator( column );
+}
+
+void wxDataViewColumn::SetSortOrder( bool ascending )
+{
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+
+ if (ascending)
+ gtk_tree_view_column_set_sort_order( column, GTK_SORT_ASCENDING );
+ else
+ gtk_tree_view_column_set_sort_order( column, GTK_SORT_DESCENDING );
+}
+
+bool wxDataViewColumn::IsSortOrderAscending()
+{
+ GtkTreeViewColumn *column = (GtkTreeViewColumn *)m_column;
+
+ return (gtk_tree_view_column_get_sort_order( column ) != GTK_SORT_DESCENDING);
+}
+
+int wxDataViewColumn::GetWidth()
+{
+ return gtk_tree_view_column_get_width( (GtkTreeViewColumn *)m_column );
+}
+
+void wxDataViewColumn::SetFixedWidth( int width )
+{
+ gtk_tree_view_column_set_fixed_width( (GtkTreeViewColumn *)m_column, width );
+}
+
+int wxDataViewColumn::GetFixedWidth()
+{
+ return gtk_tree_view_column_get_fixed_width( (GtkTreeViewColumn *)m_column );
+}
+
+//-----------------------------------------------------------------------------
+// wxDataViewCtrl signal callbacks
+//-----------------------------------------------------------------------------
+
+static void
+wxdataview_selection_changed_callback( GtkTreeSelection* selection, wxDataViewCtrl *dv )
+{
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ROW_SELECTED, dv->GetId() );
+ event.SetRow( dv->GetSelection() );
+ event.SetModel( dv->GetModel() );
+ dv->GetEventHandler()->ProcessEvent( event );
+}
+
+static void
+wxdataview_row_activated_callback( GtkTreeView* treeview, GtkTreePath *path,
+ GtkTreeViewColumn *column, wxDataViewCtrl *dv )
+{
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ROW_ACTIVATED, dv->GetId() );
+ unsigned int row = (unsigned int)gtk_tree_path_get_indices (path)[0];
+ event.SetRow( row );
+ event.SetModel( dv->GetModel() );
+ dv->GetEventHandler()->ProcessEvent( event );