Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Cocoa SWT_AWT issues, and a new API proposal

> Unlike SWT, Swing does not enforce the threading rules, which is quite
> unfortunate.

Indeed. I much prefer the SWT strict rule (exception) than all the
dirty Swing implementations with all sorts of side effects that I see
too often...

> I would suggest explicitly not supporting Swing / AWT
> applications that do not respect the Swing threading rules.

+1

> It would be good if the SWT on the Mac was more specific about this as well.

http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/guide/swt_threading.htm

"SWT follows the threading model supported directly by the platforms.
The application program runs the event loop in its main thread and
dispatches events directly from this thread. The UI thread is the
thread in which the Display was created. All other widgets must be
created in the UI thread."

I do not know exactly how to interpret "main thread". Is it the thread
from the main method? At least, that is what the given example does.
I think Mac does not allow creating a Display outside the main thread.
Is that correct (I don't have a Mac at hand to try it out)?

I updated the bug report with an example where Display is created
outside the main thread. This works on Windows and Linux and is quite
important when we don't have access to the main method:
https://bugs.eclipse.org/bugs/attachment.cgi?id=147630
I don't know if such feature can be supported on the Mac though.

-Christopher


Back to the top