diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-09-07 12:09:23 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-09-07 12:10:08 -0400 |
commit | 1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591 (patch) | |
tree | 69dd62e55d4e278e0a78b1d545cafafcddc2d025 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java | |
parent | f29e60c3bf36f15f433cda3ac2ae070ac635dffc (diff) | |
download | eclipse.platform.swt-1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591.tar.gz eclipse.platform.swt-1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591.tar.xz eclipse.platform.swt-1e698e4998cd0a3f8cc1c64d6ce4255ae7daf591.zip |
Bug 386893 - Omit use of deprecated GTK_ACCEL_LABEL_SET_ACCEL_STRING and
GTK_ACCEL_LABEL_GET_ACCEL_STRING
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java index 40c3504191..f05769a34c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java @@ -884,13 +884,15 @@ public void setText (String string) { int /*long*/ label = OS.gtk_bin_get_child (handle); if (label != 0 && OS.GTK_IS_LABEL(label)) { OS.gtk_label_set_text_with_mnemonic (label, buffer); - buffer = Converter.wcsToMbcs (null, accelString, true); - int /*long*/ ptr = OS.g_malloc (buffer.length); - OS.memmove (ptr, buffer, buffer.length); - if (OS.GTK_IS_ACCEL_LABEL(label)) { - int /*long*/ oldPtr = OS.GTK_ACCEL_LABEL_GET_ACCEL_STRING (label); - OS.GTK_ACCEL_LABEL_SET_ACCEL_STRING (label, ptr); - if (oldPtr != 0) OS.g_free (oldPtr); + if (OS.GTK_VERSION < OS.VERSION(3, 0, 0)) { + if (OS.GTK_IS_ACCEL_LABEL(label)) { + buffer = Converter.wcsToMbcs (null, accelString, true); + int /*long*/ ptr = OS.g_malloc (buffer.length); + OS.memmove (ptr, buffer, buffer.length); + int /*long*/ oldPtr = OS.GTK_ACCEL_LABEL_GET_ACCEL_STRING (label); + OS.GTK_ACCEL_LABEL_SET_ACCEL_STRING (label, ptr); + if (oldPtr != 0) OS.g_free (oldPtr); + } } } } |