Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 272379 Details for
Bug 530204
[GTK] Menu appears at mouse regardless of setLocation()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Snippet reproducing the issue
Bug530059_ShowInMenu.java (text/x-java), 1.82 KB, created by
Eric Williams
on 2018-01-23 13:10:06 EST
(
hide
)
Description:
Snippet reproducing the issue
Filename:
MIME Type:
Creator:
Eric Williams
Created:
2018-01-23 13:10:06 EST
Size:
1.82 KB
patch
obsolete
>package org.eclipse.swt.tests.gtk.snippets; > >import org.eclipse.swt.SWT; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.graphics.Point; >import org.eclipse.swt.layout.GridLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Menu; >import org.eclipse.swt.widgets.MenuItem; >import org.eclipse.swt.widgets.Shell; > >public class Bug530059_ShowInMenu { > > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout()); > > Shell dialog = new Shell (shell, SWT.APPLICATION_MODAL); > dialog.setText("Modal dialog"); > dialog.setLayout(new GridLayout()); > > Button open = new Button (shell, SWT.PUSH); > open.setText("Open dialog"); > open.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent arg0) { > dialog.open(); > } > }); > > Button button = new Button (dialog, SWT.PUSH); > button.setText("Show menu"); > > button.addSelectionListener(new SelectionAdapter() { > > @Override > public void widgetSelected(SelectionEvent arg0) { > Menu menu = new Menu (button); > Point p = button.getLocation(); > p.y = p.y + button.getSize().y; > p = button.getParent().toDisplay(p); > > System.out.println(p); > > menu.setLocation(p); > for (int i = 0; i < 5; i++) { > MenuItem item = new MenuItem(menu, SWT.PUSH); > item.setText("Item " + i); > } > menu.setVisible(true); > } > }); > > dialog.setSize(200,200); > shell.setSize(800, 800); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 530204
: 272379