summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 1b38aa9357..70e71fc6a9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -541,8 +541,7 @@ void createColumn (TableColumn column, int index) {
}
}
OS.gtk_tree_view_set_model (handle, newModel);
- OS.g_object_unref (oldModel);
- modelHandle = newModel;
+ setModel (newModel);
}
}
int /*long*/ columnHandle = OS.gtk_tree_view_column_new ();
@@ -990,8 +989,7 @@ void destroyItem (TableColumn column) {
}
}
OS.gtk_tree_view_set_model (handle, newModel);
- OS.g_object_unref (oldModel);
- modelHandle = newModel;
+ setModel (newModel);
createColumn (null, 0);
} else {
for (int i=0; i<itemCount; i++) {
@@ -3092,6 +3090,17 @@ public void setLinesVisible (boolean show) {
}
}
+void setModel (int /*long*/ newModel) {
+ display.removeWidget (modelHandle);
+ OS.g_object_unref (modelHandle);
+ modelHandle = newModel;
+ display.addWidget (modelHandle, this);
+ if (fixAccessibility ()) {
+ OS.g_signal_connect_closure (modelHandle, OS.row_inserted, display.closures [ROW_INSERTED], true);
+ OS.g_signal_connect_closure (modelHandle, OS.row_deleted, display.closures [ROW_DELETED], true);
+ }
+}
+
void setOrientation (boolean create) {
super.setOrientation (create);
for (int i=0; i<itemCount; i++) {