Bug 105494 - setting image in TreeItem column 1 affects its future column 0 image
Summary: setting image in TreeItem column 1 affects its future column 0 image
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-28 13:47 EDT by Grant Gayed CLA
Modified: 2005-08-22 16:39 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2005-07-28 13:47:53 EDT
HEAD, July 28

- run the snippet below, which initially puts an image in the item's second 
column
- press the button, which puts an image into the item's first column
  -> but it does not appear
- resize the first column slightly to make this image appear

public static void main(String[] args) {
    Display display = new Display ();
    final Image image = new Image(display, 16, 16);
    GC gc = new GC(image);
    gc.drawOval(2,2,12,6);
    gc.dispose();
    final Shell shell = new Shell(display);
    shell.setBounds(10,10,300,300);
    final Tree tree = new Tree(shell, SWT.NONE);
    tree.setBounds(10,10,200,200);
    tree.setHeaderVisible(true);
    new TreeColumn(tree, SWT.NONE).setWidth(100);
    new TreeColumn(tree, SWT.NONE).setWidth(100);
    final TreeItem item = new TreeItem(tree, SWT.NONE);
    item.setText(new String[] {"col0","col1"});
    item.setImage(1,image);
    Button button = new Button(shell, SWT.PUSH);
    button.setBounds(220,10,60,30);
    button.setText("Push");
    button.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event event) {
			item.setImage(image);
			System.out.println("image was just set into item column 
0");
			System.out.println("if you don't see it try resizing 
column 0");
		}
	});
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) display.sleep();
    }
    image.dispose();
    display.dispose();
}
Comment 1 Steve Northover CLA 2005-08-22 15:47:44 EDT
Fixed > 20051022