summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2007-04-04 21:26:47 +0000
committerSilenio Quarti <silenio>2007-04-04 21:26:47 +0000
commit466dc175612de8427d1ec5d94f52e47f363981d8 (patch)
treefccf77bc8109d72ae1ff5a97b8cf3e172ca3e736 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
parentca532f8bcfa23faaa0f20123f2c03b67fad85d18 (diff)
downloadeclipse.platform.swt-466dc175612de8427d1ec5d94f52e47f363981d8.tar.gz
eclipse.platform.swt-466dc175612de8427d1ec5d94f52e47f363981d8.tar.xz
eclipse.platform.swt-466dc175612de8427d1ec5d94f52e47f363981d8.zip
178757 - [consistency] TableColum/TreeColumns last resize listener called when control is resized
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java27
1 files changed, 10 insertions, 17 deletions
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 92377b2b4f..2feefbd69a 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
@@ -629,27 +629,20 @@ void setToolTipText (Shell shell, String newString) {
*/
public void setWidth (int width) {
checkWidget();
+ if (width == lastWidth) return;
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);
- boolean sendResize = false;
- if (!OS.gtk_tree_view_column_get_visible (handle)) {
- sendResize = OS.gtk_tree_view_column_get_fixed_width (handle) == width;
- }
OS.gtk_tree_view_column_set_fixed_width (handle, width);
- OS.gtk_tree_view_column_set_visible (handle, true);
- if (sendResize) sendEvent (SWT.Resize);
- } else {
- if (OS.gtk_tree_view_column_get_visible (handle)) {
- OS.gtk_tree_view_column_set_visible (handle, false);
- sendEvent (SWT.Resize);
- }
}
+ /*
+ * 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.
+ */
+ if (width != 0) OS.gtk_widget_realize (parent.handle);
+ OS.gtk_tree_view_column_set_visible (handle, width != 0);
+ lastWidth = width;
+ sendEvent (SWT.Resize);
}
}