SWT: single vs. multiple displays

拈花ヽ惹草 提交于 2019-12-22 08:48:36

问题


SWT is designed to support multiple Display instances, each one with its own event loop. For what purpose this is useful or required? Isn't one Display instance (e.g. Display.getDefault() sufficient?


回答1:


The docs for the Display class says "Applications which are built with SWT will almost always require only a single display". The Display instance is closely tied to the UI thread, and has certain restrictions on it in order to allow the SWT event model to work on top of the native UI event model.

The only case is if you have multiple (native) UI threads, but I am not sure in which cases this is supported. According to this quote, multiple displays are not supported on GTK or on the Mac.



来源:https://stackoverflow.com/questions/4421075/swt-single-vs-multiple-displays

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!