summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-01 11:14:15 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-08-03 22:58:20 +0530
commit195c35fb4aaf6777b97d64fa53ba79208d6d54ee (patch)
tree632df079706f08fc234f5b8c8926b6e352e30723 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java
parent165a14baa4f28638048d0b616f73e1b86413e4a2 (diff)
downloadeclipse.platform.swt-195c35fb4aaf6777b97d64fa53ba79208d6d54ee.tar.gz
eclipse.platform.swt-195c35fb4aaf6777b97d64fa53ba79208d6d54ee.tar.xz
eclipse.platform.swt-195c35fb4aaf6777b97d64fa53ba79208d6d54ee.zip
Use gtk_widget_get_allocation in newer GTK+
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.java13
1 files changed, 11 insertions, 2 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 8e835e829d..a362f0bbbc 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
@@ -390,8 +390,17 @@ int /*long*/ gtk_mnemonic_activate (int /*long*/ widget, int /*long*/ arg1) {
int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) {
useFixedWidth = false;
- int x = OS.GTK_WIDGET_X (widget);
- int width = OS.GTK_WIDGET_WIDTH (widget);
+ GtkAllocation widgetAllocation = new GtkAllocation();
+ int x = 0;
+ int width = 0;
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_get_allocation(widget, widgetAllocation);
+ x = widgetAllocation.x;
+ width = widgetAllocation.width;
+ } else {
+ x = OS.GTK_WIDGET_X (widget);
+ width = OS.GTK_WIDGET_WIDTH (widget);
+ }
if (x != lastX) {
lastX = x;
sendEvent (SWT.Move);