X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98f8e6666b4622a7dc96292f9dfb215af81573d7..9fc221aa81a8693f342376f8b65abcb4a97e7875:/src/gtk/dataview.cpp diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index f0e0d60b72..3bbb38b53b 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -1731,6 +1731,7 @@ wxDataViewRenderer::wxDataViewRenderer( const wxString &varianttype, wxDataViewC wxDataViewRendererBase( varianttype, mode, align ) { m_renderer = NULL; + m_mode = mode; // we haven't changed them yet m_usingDefaultAttrs = true; @@ -2945,6 +2946,19 @@ static void wxGtkTreeCellDataFunc( GtkTreeViewColumn *WXUNUSED(column), } // else: no custom attributes specified and we're already using the default // ones -- nothing to do + + // deal with disabled items + bool enabled = wx_model->IsEnabled( item, cell->GetOwner()->GetModelColumn()); + GValue gvalue = { 0, }; + g_value_init( &gvalue, G_TYPE_BOOLEAN ); + g_value_set_boolean( &gvalue, enabled ); + g_object_set_property( G_OBJECT(renderer), "sensitive", &gvalue ); + g_value_unset( &gvalue ); + + if (enabled) + cell->SetMode( cell->GtkGetMode() ); + else + cell->SetMode( wxDATAVIEW_CELL_INERT ); } } // extern "C"