summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe>2010-10-29 16:00:53 +0000
committerBogdan Gheorghe <gheorghe>2010-10-29 16:00:53 +0000
commit7a971401b34e1f8212a961872720628ec1408448 (patch)
tree5e8508e992569eb1359a154dc38fce6a4bc96598
parent415aa083315132f46d60c2d6116c8412c62be014 (diff)
downloadeclipse.platform.swt-7a971401b34e1f8212a961872720628ec1408448.tar.gz
eclipse.platform.swt-7a971401b34e1f8212a961872720628ec1408448.tar.xz
eclipse.platform.swt-7a971401b34e1f8212a961872720628ec1408448.zip
Cocoa snippet
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet347.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet347.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet347.java
new file mode 100644
index 0000000000..ac73980ff3
--- /dev/null
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet347.java
@@ -0,0 +1,42 @@
+//
+/*******************************************************************************
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.snippets;
+
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/*
+ * Display snippet: get the AppMenuBar on Cocoa or keep going on other platforms.
+ *
+ * For a list of all SWT example snippets see
+ * http://www.eclipse.org/swt/snippets/
+ */
+
+public class Snippet347 {
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout(1, false));
+
+
+
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+}