Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] readAndDispatch() and PaintEvent


In general, widgets are free to draw inside or outside of paint events when an API is called, but must be able to draw themselves properly when exposed.  However, when the selection is changed in a progress bar, it draws right away, otherwise the user would not see progress unless the event loop was running.  Outstanding paint events can be forced at any time using Control.update() and Display.update().

What platform are you porting to?



"Christopher Deckers" <chrriis@xxxxxxxxx>
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx

07/07/2006 02:13 PM

Please respond to
"Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] readAndDispatch() and PaintEvent





Hi,

Anyone to shed light on my previous message? (see below)

Cheers,
-Christopher

---------- Original message ----------

Hi,

I was looking at snippet 104 (win32 port) that shows a Splash Screen.
I noticed these behaviours:
- The splash screen updates (repaints) itself though we are not
dispatching the event queue.
- If we attach a Paint listener to one of the components (like the
progress bar), then PaintEvents are generated though we are not
dispatching the queue.

I thought it was mandatory to dispatch the queue to get events. Is
this wrong? Or are there some exceptions for some specific events?

Additionaly, I noticed that setting the selection on the progress bar
synchronously generates the low level paint events which synchronously
triggers repainting and the call to the paint listeners. So the splash
screen relies on this to actually render the progress of the progress
bar.
Now the problem I have is that the platform for which I am making the
port asynchronously handle paint updates. That means, if we don't
dispatch the queue, then we don't get the paint updates. Or I can call
the paint listeners, but not in the event thread.

Is there something I am missing, or could you give more details about
these dispatching rules and restrictions?

Cheers,
-Christopher
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top