简体   繁体   中英

SWT Tree under Windows XP not visible

I am developing an Eclipse RCP application and have a strange problem:

I open da new dialog window using final Shell dialog = new Shell(Display.getCurrent()); and display a tree ( Tree tree_indicators = new Tree(dialog, SWT.None); ) in it. When I run the code on my developing environment (Ubuntu 11.04 64-Bit, GTK), all is fine, the tree will be displayed correctly. When I Export the application to Win32 (32 Bit) and run it on Windows XP in a virtual Machine (using VirtualBox), the Dialog opens correctly, but the tree will not be displayed.

I also call dialog.pack(); which reserves space for the tree but it isn't visible. I have no clue what the problem is, I also do not get any error message or log entry.

Do you have any suggestions where to search for a solution?

Thanks

Solved it, was a silly mistake. When I filled the tree I set redraw to false and forgot to set it to true after filling:

// Turn off drawing to avoid flicker
       t.setRedraw(false);
        for (Indicator ind : indicators) {
            TreeItem item = new TreeItem(t, SWT.None);
            item.setText(ind.getNumber() + " " + ind.getName());
            item.setData(ind);
            // create sub elements
            for (SubIndicator subInd : ind.getSubIndicators()) {
                TreeItem child = new TreeItem(item, SWT.None);
                child.setText(subInd.getNumberString() + " " + subInd.getName());
                child.setData(subInd);
            }
        }
        // this one I forgot
        t.setRedraw(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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