简体   繁体   English

SWT MessageBox没有显示正确的图标

[英]SWT MessageBox doesn't show correct icon

I'm trying to create an error message with a MessageBox : 我正在尝试使用MessageBox创建错误消息:

MessageBox b = new MessageBox(shell, SWT.ICON_ERROR);
b.setMessage(text);
b.open();

The message box pops up just fine, but has a warning icon instead of an error icon. 消息框会弹出,但有一个警告图标而不是错误图标。

I'm using a Mac. 我正在使用Mac。 Not sure if this makes a difference, but I've played around with a couple other icons and they're all plain, they don't even correspond to their styles. 不确定这是否有所不同,但我玩过其他几个图标,它们都很普通,甚至不符合其样式。

Anyone else encounter this problem? 还有其他人遇到这个问题吗? I haven't found any information on something like this. 我还没有找到类似这样的信息。

This seems to be a bug in SWT on macOS: https://bugs.eclipse.org/bugs/show_bug.cgi?id=144689 这似乎是macOS上SWT中的错误: https ://bugs.eclipse.org/bugs/show_bug.cgi ? id = 144689

Is that the problem you are seeing? 那是您看到的问题吗?

Judging from the bug's age and the comments it seems not an easy fix and unlikely that this will be resolved soon. 从错误的年龄和评论来看,这似乎不是一个容易解决的问题,而且不太可能很快得到解决。

If you are depending on JFace already and you don't mind the non-native look, the MessageDialog. 如果您已经依赖JFace,并且不介意非本地外观,请使用MessageDialog。 and its subclasses may help you to work around this issue. 及其子类可能会帮助您解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM