Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Display.asyncExec premepts pending events


Could someone check out the post:
"[SWT] posting ASYNC events on the Display"

Basically, I would like something to run in the display loop as often as possible, but I want incoming OS events to preempt my Runnable.  Display.async(Runnable) does not do this, the runnable takes precedence, and mouse events are never processed.  I could use Display.timerExec(delay, runnable), but I don't know how much of a delay would be appropriate to ensure the the UI is responsive, and if I use too big of a delay, the CPU won't be busy.

The only thing I can think of is for my Runnable to run the Display's loop itself, and only re-post itself when there are no pending events.  The runnable needs to access Figures and SWT Images, both can only be accessed safely from the UI thread.  Is running the Display loop advisable?  I know JFace's Windows class does this already.

Back to the top