Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2005-01-25 14:31:29 +0000
committerSteve Northover2005-01-25 14:31:29 +0000
commitb4a48be4efc11f857f04c58b93e936b856510a11 (patch)
tree31d533a7266c443b382438ed6fcaf84be1a50b35 /examples
parentf18b6b74dd37d959f0ef41556e0d4d5205814712 (diff)
downloadeclipse.platform.swt-b4a48be4efc11f857f04c58b93e936b856510a11.tar.gz
eclipse.platform.swt-b4a48be4efc11f857f04c58b93e936b856510a11.tar.xz
eclipse.platform.swt-b4a48be4efc11f857f04c58b93e936b856510a11.zip
*** empty log message ***
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet178.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet178.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet178.java
index e9936af33a..9c98bfefb0 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet178.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet178.java
@@ -11,18 +11,19 @@
package org.eclipse.swt.snippets;
/*
- * How to access About, Preferences and Quit menus on carbon
+ * How to access About, Preferences and Quit menus on carbon.
+ * NOTE: This snippet uses internal SWT packages that are
+ * subject to change without notice.
*
* For a list of all SWT example snippets see
* http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/dev.html#snippets
*/
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.internal.Callback;
-import org.eclipse.swt.internal.carbon.HICommand;
-import org.eclipse.swt.internal.carbon.OS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
+
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.carbon.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.*;
public class Snippet178 {
@@ -37,15 +38,11 @@ public class Snippet178 {
public static void main(String[] arg) {
Display.setAppName("AppMenu"); // sets name in Dock
-
- Display display = Display.getDefault();
-
+ Display display = new Display();
hookApplicationMenu(display, "About AppMenu");
-
Shell shell = new Shell(display);
shell.setText("Main Window");
shell.open();
-
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();

Back to the top