summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2005-02-17 19:27:19 +0000
committerVeronika Irvine <veronika>2005-02-17 19:27:19 +0000
commitaae468902359c222878246ca5690fe9c8baf6c55 (patch)
tree935349f6935453317e8a4d3fe61cc7bf249ab692
parentce736b0eefe3baa333c3de47af6fab40b0d65a20 (diff)
downloadeclipse.platform.swt-aae468902359c222878246ca5690fe9c8baf6c55.tar.gz
eclipse.platform.swt-aae468902359c222878246ca5690fe9c8baf6c55.tar.xz
eclipse.platform.swt-aae468902359c222878246ca5690fe9c8baf6c55.zip
Bug 84557 setWidth does not make column visible if parent is not realized
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java6
2 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
index 85019fa0f9..4f41b2e3a1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java
@@ -558,6 +558,12 @@ public void setWidth (int width) {
checkWidget();
if (width > 0) {
useFixedWidth = true;
+ /*
+ * Bug in GTK. For some reason, calling gtk_tree_view_column_set_visible()
+ * when the parent is not realized fails to show the column. The fix is to
+ * ensure that the table has been realized.
+ */
+ OS.gtk_widget_realize (parent.handle);
OS.gtk_tree_view_column_set_fixed_width (handle, width);
OS.gtk_tree_view_column_set_visible (handle, true);
} else {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
index e35278b388..9b4f1545e6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
@@ -511,6 +511,12 @@ public void setWidth (int width) {
checkWidget();
if (width > 0) {
useFixedWidth = true;
+ /*
+ * Bug in GTK. For some reason, calling gtk_tree_view_column_set_visible()
+ * when the parent is not realized fails to show the column. The fix is to
+ * ensure that the table has been realized.
+ */
+ OS.gtk_widget_realize (parent.handle);
OS.gtk_tree_view_column_set_fixed_width (handle, width);
OS.gtk_tree_view_column_set_visible (handle, true);
} else {