summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-28 15:19:54 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-09-11 20:32:20 +0530
commit1ff5dc76daca83722cbc3a22652379df0452b7e8 (patch)
treed15aa6773af9fcff5254395d9d93530270af6da3 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
parent2c1e3b3d7e8ee238ed9a1b0193fa5c0af85695fa (diff)
downloadeclipse.platform.swt-1ff5dc76daca83722cbc3a22652379df0452b7e8.tar.gz
eclipse.platform.swt-1ff5dc76daca83722cbc3a22652379df0452b7e8.tar.xz
eclipse.platform.swt-1ff5dc76daca83722cbc3a22652379df0452b7e8.zip
Bug 388265 Use gtk_box_new() and gtk_box_set_homogeneous() for GTK3
This patch implements Gtk 3 methods gtk_box_new() and gtk_box_set_homogeneous() instead of deprecated gtk_hbox_new() and gtk_vbox_new()
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index 465a0f733e..e9db87b1ae 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -1834,6 +1834,21 @@ void gdk_window_get_size (int /*long*/ drawable, int[] width, int[] height) {
}
}
+int /*long*/ gtk_box_new (int orientation, boolean homogeneous, int spacing) {
+ int /*long*/ box = 0;
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ box = OS.gtk_box_new (orientation, spacing);
+ OS.gtk_box_set_homogeneous (box, homogeneous);
+ } else {
+ if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) {
+ box = OS.gtk_hbox_new (homogeneous, spacing);
+ } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) {
+ box = OS.gtk_vbox_new (homogeneous, spacing);
+ }
+ }
+ return box;
+}
+
/**
* Returns a string containing a concise, human-readable
* description of the receiver.