From 4c563b541e8dadd401851e7effcff35984e89a3a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 26 Feb 2020 14:41:12 +0000 Subject: [PATCH] Another attempt to get GTK wxDataViewCtrl to reload properly. --- pcbnew/drc/drc_tree_model.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pcbnew/drc/drc_tree_model.h b/pcbnew/drc/drc_tree_model.h index d0ce470201..9b4b8ff4bf 100644 --- a/pcbnew/drc/drc_tree_model.h +++ b/pcbnew/drc/drc_tree_model.h @@ -225,7 +225,7 @@ public: void SetProvider( DRC_ITEMS_PROVIDER* aProvider ) { - BeforeReset(); + Cleared(); delete m_drcItemsProvider; m_drcItemsProvider = aProvider; @@ -242,9 +242,16 @@ public: if( drcItem->HasSecondItem() ) node.m_Children.emplace_back( &node, drcItem, DRC_TREE_NODE::AUX_ITEM ); + + wxDataViewItemArray childItems; + + for( DRC_TREE_NODE& child : node.m_Children ) + childItems.Add( ToItem( &child ) ); + + ItemAdded( ToItem( nullptr ), ToItem( &node ) ); + ItemsAdded( ToItem( &node ), childItems ); } - AfterReset(); ExpandAll(); }