SWT: MenuItem cannot setImage in Linux
Developing an application using SWT to work in both Linux and Windows.
I created a Menu with a single MenuItem that has an image. The image in the menuItem shows on windows but not on linux. Is this expected behavior for Linux? Any workarounds?
Menu menu = new Menu(shell, SWT.POP_UP);
MenuItem item = new MenuItem开发者_开发问答(menu, SWT.PUSH);
item.setImage((ResourceManager.getPluginImage(MyPlugin.PLUGIN_ID, "icons/myimage.gif")));
item.setText("TEXT");
It's a GTK problem that can be fixed by tweaking settings - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=293720
I run ubuntu (lucid) and fixed this through running gconf-editor from the command line, navigating to desktop->gnome->interface and ticking "menus_have_icons"
精彩评论