summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2002-06-05 15:28:51 +0000
committerSilenio Quarti <silenio>2002-06-05 15:28:51 +0000
commit2c023cbbe3c181a70cb0b0641594e43819864e6b (patch)
tree8fb000e8617ec5a596d0fdc642b2983fa16d8e9e /bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
parent9cb2700ee8133266a3c10b257f5f1f7ef678579e (diff)
downloadeclipse.platform.swt-2c023cbbe3c181a70cb0b0641594e43819864e6b.tar.gz
eclipse.platform.swt-2c023cbbe3c181a70cb0b0641594e43819864e6b.tar.xz
eclipse.platform.swt-2c023cbbe3c181a70cb0b0641594e43819864e6b.zip
18804
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
index 5ed55ced96..8426c909a8 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/MenuItem.java
@@ -603,7 +603,16 @@ public void setImage (Image image) {
imageHandle = copyPhImage (image.handle);
if (text.length () != 0) type = OS.Pt_TEXT_IMAGE;
else type = OS.Pt_IMAGE;
- }
+ } else {
+ /*
+ * Bug in Photon. Photon will segment fault, if Pt_ARG_LABEL_IMAGE
+ * is set to NULL. This means that after setting an image into a
+ * PtMenuButton, it can never be removed. The fix is to set it to
+ * a small blank image.
+ */
+ Display display = getDisplay ();
+ imageHandle = copyPhImage (display.nullImage);
+ }
int [] args = {
OS.Pt_ARG_LABEL_IMAGE, imageHandle, 0,
OS.Pt_ARG_LABEL_TYPE, type, 0,