diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-29 13:42:21 -0400 |
---|---|---|
committer | Arun Thondapu <arunkumar.thondapu@in.ibm.com> | 2012-09-12 22:48:49 +0530 |
commit | 21331182885d36e87fd7aa26872a15a6f6734271 (patch) | |
tree | db8f497de54b793b2211eb3c87d6063b605e33f7 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java | |
parent | e146916783f37aa41636cc83669e5f610cf7343a (diff) | |
download | eclipse.platform.swt-21331182885d36e87fd7aa26872a15a6f6734271.tar.gz eclipse.platform.swt-21331182885d36e87fd7aa26872a15a6f6734271.tar.xz eclipse.platform.swt-21331182885d36e87fd7aa26872a15a6f6734271.zip |
Bug 388369 Use gtk_separator_new () in GTK+3
This patch replaces old GTK2 API methods gtk_vseparator_new () and
gtk_hseparator_new () with GTK+ 3 API method gtk_separator_new() and
makes old 2 methods dynamic
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 | 18 |
1 files changed, 16 insertions, 2 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 d4326cdebb..345295fae7 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 @@ -205,9 +205,9 @@ void createHandle (int index) { gtk_widget_set_has_window (fixedHandle, true); if ((style & SWT.SEPARATOR) != 0) { if ((style & SWT.HORIZONTAL)!= 0) { - handle = OS.gtk_hseparator_new (); + handle = gtk_separator_new (OS.GTK_ORIENTATION_HORIZONTAL); } else { - handle = OS.gtk_vseparator_new (); + handle = gtk_separator_new (OS.GTK_ORIENTATION_VERTICAL); } if (handle == 0) error (SWT.ERROR_NO_HANDLES); } else { @@ -584,4 +584,18 @@ void showWidget () { if (frameHandle != 0) OS.gtk_widget_show (frameHandle); if (labelHandle != 0) OS.gtk_widget_show (labelHandle); } + +int /*long*/ gtk_separator_new (int orientation) { + int /*long*/ separator = 0; + if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + separator = OS.gtk_separator_new (orientation); + } else { + if (orientation == OS.GTK_ORIENTATION_HORIZONTAL) { + separator = OS.gtk_hseparator_new (); + } else if (orientation == OS.GTK_ORIENTATION_VERTICAL) { + separator = OS.gtk_vseparator_new (); + } + } + return separator; +} } |