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


On Sep 18, 2009, at 3:58 PM, Kirill Grouchnikov wrote:

>> A few notes: display is created in the main method, as recommended  
>> by SWT. The Swing UI is created in the EDT, as recommended by AWT/ 
>> Swing.

>Are these kinds of rules documented anywhere?  If devs "follow the  
>rules" as defined in this example, I don't have to make that many  
>changes to Shell or Display, except to detect when the Shell doesn't  
>own its window, as would be the case in the SWT_AWT new_Shell state.

Unlike SWT, Swing does not enforce the threading rules, which is quite unfortunate. I would suggest explicitly not supporting Swing / AWT applications that do not respect the Swing threading rules.

Actually, the rules I had in mind were regarding the use of SWT_AWT, but your point is also valid. On the Mac, anyway, the penalty for not following the threading rules is almost always catastrophic.

It would be good if the SWT on the Mac was more specific about this as well. Creating a Display on any thread other than [NSThread mainThread] is pointless and pretty much guaranteed to not do what you want, as I discovered early on.

-- Scott K.


Back to the top