Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OS X Bug? MouseListener behaving incorrectly on Button
OS X Bug? MouseListener behaving incorrectly on Button [message #441696] Fri, 20 August 2004 12:35 Go to next message
Jelle Herold is currently offline Jelle HeroldFriend
Messages: 42
Registered: July 2009
Member
Hi,

I believe this is a OS X specific bug:

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;

public class MouseBug implements MouseListener
{
public static void main(String[] args)
{
Display display = Display.getDefault();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setSize(100,100);
MouseBug mousebug = new MouseBug();

// works correctly under OS X
// mouse pressed: mouse up event generated
// mouse released: mouse down event generated
// double click: 2 x up, down, and 1 x double click
// event generated
Canvas canvas = new Canvas(shell, SWT.NONE);
canvas.addMouseListener(mousebug);

// doesn't work as expected under OS X:
// mouse pressed: nothing happens
// mouse released: mouse down event generated
// double click: works (same as canvas)
Button button = new Button(shell, SWT.NONE);
button.addMouseListener(mousebug);

shell.pack();
shell.open();

while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
}

public void mouseDoubleClick(MouseEvent arg0)
{
System.out.println("mouse double click");
}

public void mouseDown(MouseEvent arg0)
{
System.out.println("mouse down");
}

public void mouseUp(MouseEvent arg0)
{
System.out.println("mouse up");
}
}

Thanks
Jelle
--
http://o2w.nl/~jelle/
http://defekt.nl/
Re: OS X Bug? MouseListener behaving incorrectly on Button [message #441698 is a reply to message #441696] Fri, 20 August 2004 13:00 Go to previous message
Jelle Herold is currently offline Jelle HeroldFriend
Messages: 42
Registered: July 2009
Member
On 2004-08-20, Jelle Herold <jelle@defekt.nl> wrote:
> I believe this is a OS X specific bug:

OK, i'm somewhat new to this, but i've entered a bug report... sorry to
clutter this newsgroup with this...

https://bugs.eclipse.org/bugs/show_bug.cgi?id=72342

Cheers
--
http://o2w.nl/~jelle/
http://defekt.nl/
Previous Topic:Drag and Drop from custom view to an Editor
Next Topic:TableItem Row resizing
Goto Forum:
  


Current Time: Fri Apr 26 14:16:22 GMT 2024

Powered by FUDForum. Page generated in 0.02687 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top