Bug 246415 - Shell gets deactivate event when Help menu is opened
Summary: Shell gets deactivate event when Help menu is opened
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Scott Kovatch CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-05 14:44 EDT by Kevin Barnes CLA
Modified: 2019-09-06 16:12 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Barnes CLA 2008-09-05 14:44:34 EDT
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();
		}
	}
Comment 1 Scott Kovatch CLA 2010-06-02 14:03:30 EDT
Mass move of Kevin's open Mac Carbon & Cocoa bugs to Scott K.
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:12:42 EDT
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.