Home » Eclipse Projects » Rich Client Platform (RCP) » Loss of Mouse events and OBSCURED widgets
Loss of Mouse events and OBSCURED widgets [message #489296] |
Fri, 02 October 2009 09:45 |
Thomas SZADEL Messages: 36 Registered: July 2009 |
Member |
|
|
Hi all,
I'm currently developing an RCP application (Eclipse 3.4.1 on Linux Redhat 5).
Basically, I need a view that contains a grid of buttons (let's say 4 rows x 6 columns).
These buttons need to be big, flat and with a solid color.
They are created at the begining and never destroyed.
Each time the user clicks on a button, the whole grid is repainted and the buttons can have a different color, visibilty and or text.
Problem: after up to 1h30, the buttons are slowly dying one after the others... They no more receive any mouse event.
In debug mode, I have seen that the Display#runDeferredEvents does not receive any event when the mouse is over them.
The widget that is related to the button has its state sets to SWT.OBSCURED.
At the begining, I used a "custom" button built on a Composite (SWT.BORDER) with a child label (SWT.CENTER) and a mouse listener.
==> The problem appears after 30 min
I have seen in the doc that the SWT.CENTER flag may cause an OBSCURED state under Linux.
Thus, I have removed all the Labels and now, I draw the text (thanks to a PaintListener)
==> The problem appears after 1h / 1h30
I have replaced the Composite by a Canvas: same result
I have replaced the Canvas by a real SWT button: same result
Finally, I have removed all the buttons and replaced them by a single Canvas on which I paint all the buttons by myself.
==> it seems to works
... but unfortunately, I have another view that contains a button, a table and labels... and sometimes the problem occurs
... and I can't redraw by hand the whole application!!!
So, can anybody help me???
Thanks!!
|
|
|
Re: Loss of Mouse events and OBSCURED widgets [message #489706 is a reply to message #489296] |
Mon, 05 October 2009 15:34 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have not heard of a problem like this before. When you say the whole grid
is repainted, do you just mean you invoke
setForeground()/setVisible()/setText() on some/all of the Buttons? The
symptoms give the impression of running out of memory, so maybe there's a
leak in swt? Are you able to provide a snippet based on your app that shows
the problem happening (ideal template:
http://www.eclipse.org/swt/faq.php#whatisasnippet )? Also, are you able to
try with eclipse 3.5.1 (
http://download.eclipse.org/eclipse/downloads/drops/R-3.5.1- 200909170800/index.php )
?
Grant
"Thomas SZADEL" <thomas.szadel@atosorigin.com> wrote in message
news:ha4i3h$7tj$1@build.eclipse.org...
> Hi all,
>
> I'm currently developing an RCP application (Eclipse 3.4.1 on Linux Redhat
5).
>
> Basically, I need a view that contains a grid of buttons (let's say 4 rows
x 6 columns).
> These buttons need to be big, flat and with a solid color.
> They are created at the begining and never destroyed.
> Each time the user clicks on a button, the whole grid is repainted and the
buttons can have a different color, visibilty and or text.
>
> Problem: after up to 1h30, the buttons are slowly dying one after the
others... They no more receive any mouse event.
>
> In debug mode, I have seen that the Display#runDeferredEvents does not
receive any event when the mouse is over them.
> The widget that is related to the button has its state sets to
SWT.OBSCURED.
>
> At the begining, I used a "custom" button built on a Composite
(SWT.BORDER) with a child label (SWT.CENTER) and a mouse listener.
> ==> The problem appears after 30 min
>
> I have seen in the doc that the SWT.CENTER flag may cause an OBSCURED
state under Linux.
> Thus, I have removed all the Labels and now, I draw the text (thanks to a
PaintListener)
> ==> The problem appears after 1h / 1h30
>
> I have replaced the Composite by a Canvas: same result
> I have replaced the Canvas by a real SWT button: same result
>
> Finally, I have removed all the buttons and replaced them by a single
Canvas on which I paint all the buttons by myself.
> ==> it seems to works :)
>
> .. but unfortunately, I have another view that contains a button, a table
and labels... and sometimes the problem occurs :(
>
> .. and I can't redraw by hand the whole application!!!
>
> So, can anybody help me???
>
> Thanks!!
|
|
| | | | |
Goto Forum:
Current Time: Fri Apr 19 18:03:51 GMT 2024
Powered by FUDForum. Page generated in 0.03371 seconds
|