diff options
author | Silenio Quarti <silenio> | 2007-04-04 21:26:47 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2007-04-04 21:26:47 +0000 |
commit | 466dc175612de8427d1ec5d94f52e47f363981d8 (patch) | |
tree | fccf77bc8109d72ae1ff5a97b8cf3e172ca3e736 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java | |
parent | ca532f8bcfa23faaa0f20123f2c03b67fad85d18 (diff) | |
download | eclipse.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.java | 27 |
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); } } |