Community
Participate
Working Groups
Run the following Snippet, open the Help menu. Notice that the shell gets a deactivate event. Deactivate is being sent with the window resigns key. In this case the text field in the Help menu is causing the menu's window to become key. public static void main(String[] args) { try { final Display display = new Display(); Display.setAppName("Menu Test"); final Shell shell = new Shell(display); shell.setText("I made this"); Menu bar = new Menu(shell, SWT.BAR); shell.setMenuBar(bar); MenuItem help = new MenuItem(bar, SWT.CASCADE); help.setText("Help"); Menu submenu = new Menu(shell, SWT.DROP_DOWN); help.setMenu(submenu); MenuItem item = new MenuItem(submenu, SWT.PUSH); item.setText("a menu item"); shell.setSize(200, 200); shell.addListener(SWT.Deactivate, new Listener() { public void handleEvent(Event event) { System.out.println("deactivate"); } }); shell.open(); while (!shell.isDisposed() ) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } catch (Throwable t) { t.printStackTrace(); } }
Mass move of Kevin's open Mac Carbon & Cocoa bugs to Scott K.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.