SWT:单显示器与多显示器 [英] SWT: single vs. multiple displays

查看:52
本文介绍了SWT:单显示器与多显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SWT 旨在支持多个 Display 实例,每个实例都有自己的事件循环.出于什么目的,这是有用的或必需的?难道一个 Display 实例(例如 Display.getDefault() 就足够了?

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?

推荐答案

Display 类的文档说使用 SWT 构建的应用程序几乎总是只需要一个显示器".Display 实例与 UI 线程紧密相连,并对其有一定的限制,以允许 SWT 事件模型在本机 UI 事件模型之上工作.

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.

唯一的情况是如果您有多个(本机)UI 线程,但我不确定在哪些情况下支持.根据此引述,不支持多显示器GTK 或在 Mac 上.

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.

这篇关于SWT:单显示器与多显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆