Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug493552_NativeTestGDK.java')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug493552_NativeTestGDK.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug493552_NativeTestGDK.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug493552_NativeTestGDK.java
new file mode 100644
index 0000000000..b60c7afb91
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug493552_NativeTestGDK.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Red Hat 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:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+
+//import org.eclipse.swt.internal.gtk.OS;
+
+/*
+ * NOTE: this snippet requires OS.ascii() to be public in order to function.
+ * Please modify its api.visibility and uncomment the rest of the snippet.
+ */
+
+public class Bug493552_NativeTestGDK {
+
+
+ public static void main(String[] args) {
+// OS.gtk_init_check(new long[0], new long[0]);
+// /* create a new window */
+// long window = OS.gtk_window_new(OS.GTK_WINDOW_TOPLEVEL);
+// OS.gtk_window_set_title(window, OS.ascii("GTK Menu Test"));
+// long widget.menu = OS.gtk_menu_new();
+// long root_menu = OS.gtk_image_menu_item_new_with_label(OS.ascii("Root Menu"));
+// OS.gtk_widget_show(root_menu);
+// for(int i = 0; i < 3; i++) {
+// String buf = "Test-undermenu -" + i;
+// long menu_items = OS.gtk_image_menu_item_new_with_label(OS.ascii(buf));
+// OS.gtk_menu_shell_insert(widget.menu, menu_items, i);
+// OS.gtk_widget_show(menu_items);
+// }
+// /* Now we specify that we want our newly created "widget.menu" to be the widget.menu for the "root widget.menu" */
+// OS.gtk_menu_item_set_submenu(root_menu, widget.menu);
+// /* Create a widget.menu-bar to hold the menus and add it to our main window*/
+// long menu_bar = OS.gtk_menu_bar_new();
+// OS.gtk_container_add(window, menu_bar);
+// OS.gtk_widget_show(menu_bar);
+// OS.gtk_menu_shell_insert(menu_bar, root_menu, 0);
+// OS.gtk_widget_show(window);
+// long /*int*/ screen = OS.gdk_screen_get_default ();
+//// int monitorNumber = OS.gdk_screen_get_monitor_at_window (screen, OS.gtk_widget_get_window(window));
+// int monitorNumber = OS.gdk_screen_get_primary_monitor (screen);
+// System.out.println("Primary monitorNumber " + monitorNumber);
+// OS.gtk_main ();
+ }
+
+
+}

Back to the top