Community
Participate
Working Groups
GTK3 doesn't fire PaintItem event Tested on GTK 3.14.5, SWT 4510 Probably broken by https://bugs.eclipse.org/bugs/show_bug.cgi?id=427480#c6 which disables "sendEvent (SWT.PaintItem, event)" when GTK version is >= 3.9. Sample code below should paint "This text should be drawn" as it does on GTK2 and other platforms: public static void main(String[] args) { Display display = new Display(); Shell shellMain = new Shell(display, SWT.SHELL_TRIM); shellMain.setLayout(new FillLayout(SWT.VERTICAL)); Tree tree = new Tree(shellMain, SWT.BORDER); new TreeItem(tree, SWT.NONE).setText("setText"); tree.addListener(SWT.PaintItem, new Listener() { public void handleEvent(Event event) { System.out.println("PaintItem"); Rectangle bounds = ((TreeItem) event.item).getBounds(event.index); event.gc.fillRectangle(bounds.x, bounds.y, bounds.width, bounds.height); event.gc.drawText("This text should be drawn", bounds.x, bounds.y, true); } }); shellMain.open(); while (!shellMain.isDisposed()) { try { if (!display.readAndDispatch()) display.sleep(); } catch (Throwable t) { t.printStackTrace(); } } display.dispose(); }
Still not working in 4524
Fixed by commits from Bug 427511 and/or Bug 446075