summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-07-06 15:22:07 -0400
committerAnatoly Spektor <aspektor@redhat.com>2012-07-06 15:22:07 -0400
commit31b12b14d0469ce6ab08e9d908e15532aee06ded (patch)
tree8098a5aa4292daa1c48781a940de12de262fbc4b
parent6f7e9db4a5109de2cb967f8161a35ca18fee8f28 (diff)
downloadeclipse.platform.swt-gtk_widget_set_has_window.tar.gz
eclipse.platform.swt-gtk_widget_set_has_window.tar.xz
eclipse.platform.swt-gtk_widget_set_has_window.zip
Use gtk_widget_set_has_window() instead of gtk_fixed_set_has_window()gtk_widget_set_has_window
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java6
24 files changed, 145 insertions, 25 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 1c8c5a54fb..aa5c6dc49b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -9712,7 +9712,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1fixed_1set_1has_1window)
(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
{
OS_NATIVE_ENTER(env, that, _1gtk_1fixed_1set_1has_1window_FUNC);
- gtk_fixed_set_has_window((GtkFixed *)arg0, (gboolean)arg1);
+/*
+ gtk_fixed_set_has_window(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_fixed_set_has_window)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1fixed_1set_1has_1window_FUNC);
}
#endif
@@ -16796,6 +16804,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1double_1buffered)
}
#endif
+#ifndef NO__1gtk_1widget_1set_1has_1window
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1has_1window)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1has_1window_FUNC);
+/*
+ gtk_widget_set_has_window(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_has_window)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1has_1window_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1widget_1set_1name
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1name)
(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 2e537a9f6c..87123e4ed3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -187,6 +187,8 @@
#define gtk_widget_is_composited_LIB LIB_GTK
#define gtk_widget_get_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
+#define gtk_widget_set_has_window_LIB LIB_GTK
+#define gtk_fixed_set_has_window_LIB LIB_GTK
#define gdk_pango_context_set_colormap_LIB LIB_GDK
#define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index f444a423e7..0c1a3bd0a5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1402;
-int OS_nativeFunctionCallCount[1402];
+int OS_nativeFunctionCount = 1403;
+int OS_nativeFunctionCallCount[1403];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -1328,6 +1328,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1set_1default_1direction",
"_1gtk_1widget_1set_1direction",
"_1gtk_1widget_1set_1double_1buffered",
+ "_1gtk_1widget_1set_1has_1window",
"_1gtk_1widget_1set_1name",
"_1gtk_1widget_1set_1parent_1window",
"_1gtk_1widget_1set_1redraw_1on_1allocate",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index f7321e2d6a..2d52f9fc9b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -1336,6 +1336,7 @@ typedef enum {
_1gtk_1widget_1set_1default_1direction_FUNC,
_1gtk_1widget_1set_1direction_FUNC,
_1gtk_1widget_1set_1double_1buffered_FUNC,
+ _1gtk_1widget_1set_1has_1window_FUNC,
_1gtk_1widget_1set_1name_FUNC,
_1gtk_1widget_1set_1parent_1window_FUNC,
_1gtk_1widget_1set_1redraw_1on_1allocate_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 8827bda6b3..d23edbefbe 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -7433,8 +7433,7 @@ public static final int /*long*/ gtk_fixed_new() {
}
}
/**
- * @param fixed cast=(GtkFixed *)
- * @param has_window cast=(gboolean)
+ * @method flags=dynamic
*/
public static final native void _gtk_fixed_set_has_window(int /*long*/ fixed, boolean has_window);
public static final void gtk_fixed_set_has_window(int /*long*/ fixed, boolean has_window) {
@@ -7445,6 +7444,18 @@ public static final void gtk_fixed_set_has_window(int /*long*/ fixed, boolean ha
lock.unlock();
}
}
+/**
+ * @method flags=dynamic
+ */
+public static final native void _gtk_widget_set_has_window(int /*long*/ widget, boolean has_window);
+public static final void gtk_widget_set_has_window(int /*long*/ widget, boolean has_window) {
+ lock.lock();
+ try {
+ _gtk_fixed_set_has_window(widget, has_window);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param fsd cast=(GtkFontSelectionDialog *) */
public static final native int /*long*/ _gtk_font_selection_dialog_get_font_name(int /*long*/ fsd);
public static final int /*long*/ gtk_font_selection_dialog_get_font_name(int /*long*/ fsd) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 33681fb533..ed7d7c8f01 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -258,7 +258,11 @@ void createHandle (int index) {
int bits = SWT.ARROW | SWT.TOGGLE | SWT.CHECK | SWT.RADIO | SWT.PUSH;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
switch (style & bits) {
case SWT.ARROW:
int arrow_type = OS.GTK_ARROW_UP;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index e9ee34b2df..4dd3ed467b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -366,7 +366,11 @@ void createHandle (int index) {
state |= HANDLE | MENU;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ oldList = OS.gtk_window_list_toplevels ();
if ((style & SWT.READ_ONLY) != 0) {
handle = OS.gtk_combo_box_new_text ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 561dfa3a59..ac3a695ec3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -262,8 +262,12 @@ void createHandle (int index, boolean fixed, boolean scrolled) {
if (fixed) {
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
OS.gtk_fixed_set_has_window (fixedHandle, true);
}
+ }
int /*long*/ vadj = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (vadj == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ hadj = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
@@ -273,7 +277,11 @@ void createHandle (int index, boolean fixed, boolean scrolled) {
}
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (handle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(handle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (handle, true);
+ }
OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS);
if ((style & SWT.EMBEDDED) == 0) {
if ((state & CANVAS) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index 020e8a958c..12cd05459c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -339,7 +339,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_calendar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
index ef8661e2d1..3750df0b65 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
@@ -129,7 +129,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_vbox_new (false, 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.V_SCROLL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
index 40e6c20bc5..3600299cdc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
@@ -122,7 +122,11 @@ void createHandle(int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_frame_new (null);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
labelHandle = OS.gtk_label_new (null);
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 9323ae3fa5..173e89f0de 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
@@ -202,7 +202,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
if ((style & SWT.SEPARATOR) != 0) {
if ((style & SWT.HORIZONTAL)!= 0) {
handle = OS.gtk_hseparator_new ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
index 9d8a7f20d2..411c3c67e0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
@@ -145,7 +145,11 @@ void createHandle(int index) {
state |= HANDLE | THEME_BACKGROUND;
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (handle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(handle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (handle, true);
+ }
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
layout = new TextLayout (display);
linkColor = new Color (display, LINK_FOREGROUND);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index a4bc31fb68..58b04e18c2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -189,7 +189,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index 811cecd5bf..f3adad7702 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -83,7 +83,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_progress_bar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
index 693b0412c5..fe74f40548 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
@@ -136,7 +136,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (handle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(handle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (handle, true);
+ }
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
int type = (style & SWT.VERTICAL) != 0 ? OS.GDK_SB_H_DOUBLE_ARROW : OS.GDK_SB_V_DOUBLE_ARROW;
defaultCursor = OS.gdk_cursor_new (type);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
index c29f7c5c05..d85d59be05 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
@@ -125,7 +125,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
index 8b20f25e10..c990d0687c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
@@ -152,7 +152,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index 87b57f3bd2..d1d591a89a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -290,7 +290,11 @@ void createHandle (int index) {
state |= HANDLE | MENU;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ adjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (adjustment == 0) error (SWT.ERROR_NO_HANDLES);
handle = OS.gtk_spin_button_new (adjustment, climbRate, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 7302454dc9..8e3ad6ec89 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -184,8 +184,11 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
- if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_notebook_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 465fbec8f6..d3373cfdfb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -593,7 +593,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ [] types = getColumnTypes (1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index 75646e91cf..224d74efff 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -193,7 +193,11 @@ void createHandle (int index) {
}
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
if ((style & SWT.SINGLE) != 0) {
handle = OS.gtk_entry_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index e470cd5ff9..fa45445f17 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -130,7 +130,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_toolbar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 6c9eefffe8..0e141ee409 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -698,7 +698,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ [] types = getColumnTypes (1);