|
Re: mouseExit event missing. [message #514152 is a reply to message #513944] |
Fri, 12 February 2010 15:27 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi,
It could be an swt bug, but I have not heard of it before, and could not
reproduce it with a snippet (below) on Ubuntu. Does the snippet below show
the problem for you? And if not, are you able to change it to show the
problem?
public static void main(String[] args) {
final Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10,10,200,200);
Shell shell2 = new Shell(shell, SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
shell2.setBounds(200,200,200,200);
Button button = new Button(shell2, SWT.PUSH);
button.setBounds(50,50,50,50);
button.addMouseTrackListener(new MouseTrackAdapter() {
public void mouseEnter(MouseEvent e) {
System.out.println("ENTER");
}
public void mouseExit(MouseEvent e) {
System.out.println("EXIT");
}
});
shell.open();
shell2.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
Grant
"Kamil" <soccki@o2.pl> wrote in message
news:hl1i6e$8al$1@build.eclipse.org...
> I'm using MouseTrackListener to change the text color of button text. I
get the mouseEnter event and change the text color but when cursor moves
rapidly out off button and dialog then there is no mouseExit event(only when
it rapidly exits dialog).
> This problem shows up only in modal dialogs.
> OS is gentoo. Can't tell if it works or not on windows because changing
text color in button doesn't work at all.
> Anyone had simmilar or the same problem?
> Is it an OS error or coder error? :)
>
> Kamil Wysocki
|
|
|
Re: mouseExit event missing. [message #514290 is a reply to message #514152] |
Sat, 13 February 2010 18:36 |
Kamil Messages: 4 Registered: February 2010 |
Junior Member |
|
|
Hi,
problem still exists. Modal window must be above the parent window. try moving mouse down from button using code bellow.
Thank you again.
final Display display = new Display();
Shell shell = new Shell(display);
shell.setBounds(10,10,800,500);
Shell shell2 = new Shell(shell, SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
shell2.setBounds(200,200,125,125);
Button button = new Button(shell2, SWT.PUSH);
button.setBounds(50,50,50,50);
button.addMouseTrackListener(new MouseTrackAdapter() {
public void mouseEnter(MouseEvent e) {
System.out.println("ENTER");
}
public void mouseExit(MouseEvent e) {
System.out.println("EXIT");
}
});
shell.open();
shell2.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
|
|
|
Re: mouseExit event missing. [message #514781 is a reply to message #514290] |
Tue, 16 February 2010 15:34 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
I see, I've logged https://bugs.eclipse.org/bugs/show_bug.cgi?id=302956 ,
thanks!
Grant
"Kamil" <soccki@o2.pl> wrote in message
news:hl6rem$njt$1@build.eclipse.org...
> Hi,
>
> problem still exists. Modal window must be above the parent window. try
moving mouse down from button using code bellow.
> Thank you again.
>
> final Display display = new Display();
> Shell shell = new Shell(display);
> shell.setBounds(10,10,800,500);
> Shell shell2 = new Shell(shell, SWT.APPLICATION_MODAL | SWT.SHELL_TRIM);
> shell2.setBounds(200,200,125,125);
> Button button = new Button(shell2, SWT.PUSH);
> button.setBounds(50,50,50,50);
> button.addMouseTrackListener(new MouseTrackAdapter() {
> public void mouseEnter(MouseEvent e) {
> System.out.println("ENTER");
> }
> public void mouseExit(MouseEvent e) {
> System.out.println("EXIT");
> }
> });
> shell.open();
> shell2.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch()) display.sleep();
> }
> display.dispose();
> }
|
|
|
Powered by
FUDForum. Page generated in 0.04156 seconds