Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » mouseExit event missing.
mouseExit event missing. [message #513944] Thu, 11 February 2010 18:27 Go to next message
Kamil  is currently offline Kamil Friend
Messages: 4
Registered: February 2010
Junior Member
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? Smile

Kamil Wysocki
Re: mouseExit event missing. [message #514152 is a reply to message #513944] Fri, 12 February 2010 15:27 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
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 Go to previous messageGo to next message
Kamil  is currently offline Kamil Friend
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 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
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();
> }
Previous Topic:table row selection on windows
Next Topic:Widget enable event
Goto Forum:
  


Current Time: Fri Apr 19 10:20:14 GMT 2024

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

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

Back to the top