From b2711372e321f1d46148c930a5bd50d663263ba4 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Tue, 20 Aug 2013 13:49:05 +0300 Subject: Bug 411452 - Search dialogue isn't "reusable" when using GTK 3.x Hack for GTK3 in order to not get cellDataFunc while clearing as it calls it for each row-deleted and this causes AAIOB in getId as items are already cleared but the model is not yet. By disconnecting the model from the handle while clearing no intermediate signals are emitted. Signed-off-by: Alexander Kurtakov --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index 9472527116..474ff376ee 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -2369,7 +2369,14 @@ public void removeAll () { if (fixAccessibility ()) { ignoreAccessibility = true; } + /** + * Hack for GTK3 in order to not get cellDataFunc while clearing as it calls it for each row-deleted + * and this causes AAIOB in getId as items are already cleared but the model is not yet. + * By disconnecting the model from the handle while clearing no intermediate signals are emitted. + */ + OS.gtk_tree_view_set_model(handle, 0); OS.gtk_tree_store_clear (modelHandle); + OS.gtk_tree_view_set_model(handle, modelHandle); if (fixAccessibility ()) { ignoreAccessibility = false; OS.g_object_notify (handle, OS.model); -- cgit v1.2.3