diff --git a/docs/changes.txt b/docs/changes.txt index c2edd51abd..4beac69e93 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -71,6 +71,7 @@ All (GUI): wxGTK: - Implement setting link colours in wxHyperlinkCtrl for GTK+3 (Hanmac). +- Support background colour in wxDataViewCtrl attributes. wxMSW: diff --git a/samples/dataview/mymodels.cpp b/samples/dataview/mymodels.cpp index 590d3f2e67..bf6b219206 100644 --- a/samples/dataview/mymodels.cpp +++ b/samples/dataview/mymodels.cpp @@ -470,7 +470,8 @@ bool MyListModel::GetAttrByRow( unsigned int row, unsigned int col, case Col_IconText: if ( !(row % 2) ) return false; - attr.SetColour(*wxLIGHT_GREY); + attr.SetColour(*wxYELLOW); + attr.SetBackgroundColour(*wxLIGHT_GREY); break; case Col_TextWithAttr: diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 4e04d7994e..2e73aae7b2 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -2248,7 +2248,6 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr) g_value_unset( &gvalue ); } -#if 0 if (attr.HasBackgroundColour()) { wxColour colour = attr.GetBackgroundColour(); @@ -2268,7 +2267,6 @@ void GtkApplyAttr(GtkCellRendererText *renderer, const wxDataViewItemAttr& attr) g_object_set_property( G_OBJECT(renderer), "cell-background-set", &gvalue ); g_value_unset( &gvalue ); } -#endif } } // anonymous namespace