diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-27 15:37:40 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-27 15:38:42 -0400 |
commit | 9effcc166dfa61e54b0f9bb76b17f1175f53b69b (patch) | |
tree | 4067e33bd1e51787f534cc6d4887914a337e4961 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java | |
parent | a3a1752d4cca52a10819bc086957df9ad04a0a87 (diff) | |
download | eclipse.platform.swt-9effcc166dfa61e54b0f9bb76b17f1175f53b69b.tar.gz eclipse.platform.swt-9effcc166dfa61e54b0f9bb76b17f1175f53b69b.tar.xz eclipse.platform.swt-9effcc166dfa61e54b0f9bb76b17f1175f53b69b.zip |
Bug 386401 - Use gtk_widget_get_allocation in newer GTK+
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java index 66ffce244d..4885a1b520 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java @@ -465,17 +465,10 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize * resized so that it will draw wrapped. */ if (fixWrap) { - int labelWidth = 0; - int labelHeight = 0; GtkAllocation allocation = new GtkAllocation(); - if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { - OS.gtk_widget_get_allocation(handle, allocation); - labelWidth = allocation.width; - labelHeight = allocation.height; - } else { - labelWidth = OS.GTK_WIDGET_WIDTH (handle); - labelHeight = OS.GTK_WIDGET_HEIGHT (handle); - } + gtk_widget_get_allocation (handle, allocation); + int labelWidth = allocation.width; + int labelHeight = allocation.height; OS.gtk_widget_set_size_request (labelHandle, labelWidth, labelHeight); /* * Bug in GTK. Setting the size request should invalidate the label's @@ -483,12 +476,7 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize */ GtkRequisition requisition = new GtkRequisition (); OS.gtk_widget_size_request (labelHandle, requisition); - if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { - OS.gtk_widget_get_allocation(labelHandle, allocation); - } else { - allocation.x = OS.GTK_WIDGET_X (labelHandle); - allocation.y = OS.GTK_WIDGET_Y (labelHandle); - } + gtk_widget_get_allocation(labelHandle, allocation); allocation.width = labelWidth; allocation.height = labelHeight; OS.gtk_widget_size_allocate (labelHandle, allocation); |