Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2011-10-19 14:49:49 -0400
committerFelipe Heidrich2011-10-19 14:49:49 -0400
commit83784a0bd43bf551a0a4fb21e5409eeadecd384d (patch)
tree00a166c3c25407fa8b24266bbb821542554f4757 /examples
parent1842fb6618b874714b89bdeb1ef17cab740bfb5f (diff)
downloadeclipse.platform.swt-83784a0bd43bf551a0a4fb21e5409eeadecd384d.tar.gz
eclipse.platform.swt-83784a0bd43bf551a0a4fb21e5409eeadecd384d.tar.xz
eclipse.platform.swt-83784a0bd43bf551a0a4fb21e5409eeadecd384d.zip
Bug 304001 - [mac] No SWT API to set highlighted image for status item
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java
index 314a925b06..b52865ac8b 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet143.java
@@ -28,6 +28,11 @@ public static void main(String[] args) {
Display display = new Display ();
Shell shell = new Shell (display);
Image image = new Image (display, 16, 16);
+ Image image2 = new Image (display, 16, 16);
+ GC gc = new GC(image2);
+ gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
+ gc.fillRectangle(image2.getBounds());
+ gc.dispose();
final Tray tray = display.getSystemTray ();
if (tray == null) {
System.out.println ("The system tray is not available");
@@ -70,7 +75,8 @@ public static void main(String[] args) {
menu.setVisible (true);
}
});
- item.setImage (image);
+ item.setImage (image2);
+ item.setHighlightImage (image);
}
shell.setBounds(50, 50, 300, 200);
shell.open ();
@@ -78,6 +84,7 @@ public static void main(String[] args) {
if (!display.readAndDispatch ()) display.sleep ();
}
image.dispose ();
+ image2.dispose ();
display.dispose ();
}
}

Back to the top