+
+ if (m_isConnected)
+ {
+ // disconnect before column->button gets recreated
+ g_signal_handlers_disconnect_by_func( column->button,
+ (void*) gtk_dataview_header_button_press_callback, this);
+
+ m_isConnected = false;
+ }
+
+ // FIXME: can it really happen that we don't have the owner here??
+ wxDataViewCtrl *ctrl = GetOwner();
+ gtk_tree_view_column_set_title( column, ctrl ? wxGTK_CONV_FONT(title, ctrl->GetFont())
+ : wxGTK_CONV_SYS(title) );
+
+ 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);