Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 37428 - Extra pop up menu on text widget with setMenu
Summary: Extra pop up menu on text widget with setMenu
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 38731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-09 11:02 EDT by Veronika Irvine CLA
Modified: 2003-07-18 10:53 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veronika Irvine CLA 2003-05-09 11:02:50 EDT
Eclipse 2.1

Run the following code.  Right click in the text widget and you will see a
native pop up menu as well as the one I have added.
Also happens with Shift+F10.

public static void main(String[] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	final Text t = new Text(shell, SWT.READ_ONLY | SWT.BORDER |SWT.V_SCROLL |
SWT.H_SCROLL | SWT.MULTI);
	t.setBounds(10, 10, 250, 250);
	Menu menu = new Menu (shell, SWT.POP_UP);
	MenuItem item = new MenuItem (menu, SWT.PUSH);
	item.setText ("Clear");
	item.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			t.setText("");
		}
	});
	t.setMenu(menu);
	shell.pack();
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
Comment 1 Felipe Heidrich CLA 2003-06-19 17:29:09 EDT
*** Bug 38731 has been marked as a duplicate of this bug. ***
Comment 2 Felipe Heidrich CLA 2003-07-11 17:34:52 EDT
Fixed > 20030711