Bug 119915 - Hot image always showing for ToolItem on Mac
Summary: Hot image always showing for ToolItem on Mac
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-08 12:27 EST by Curtis d'Entremont CLA
Modified: 2012-06-20 14:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis d'Entremont CLA 2005-12-08 12:27:21 EST
N20051208-0010

I have a toolbar with a ToolItem, I want a different image to appear when the mouse hovers, so I do both setImage() and setHotImage() on the tool item. However, on the mac, I only ever see the hot item.

Here's a simple example that demonstrates the problem:

--------------------

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());
    
    Image normalImage = new Image(display, 16, 16);
    GC gc = new GC(normalImage);
    gc.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
    gc.fillRectangle(0, 0, 16, 16);
    gc.dispose();

    Image hotImage = new Image(display, 16, 16);
    gc = new GC(hotImage);
    gc.setBackground(display.getSystemColor(SWT.COLOR_RED));
    gc.fillRectangle(0, 0, 16, 16);
    gc.dispose();
    
    ToolBar bar = new ToolBar(shell, SWT.FLAT);
    ToolItem item = new ToolItem(bar, SWT.NONE);
    item.setImage(normalImage);
    item.setHotImage(hotImage);
    
    shell.pack();
    shell.open();

    while (!shell.isDisposed()) {
    	if (!display.readAndDispatch()) {
    		display.sleep();
    	}
    }
    normalImage.dispose();
    hotImage.dispose();
    display.dispose();
}
Comment 1 Silenio Quarti CLA 2012-06-20 14:39:58 EDT
Closing report, platform is discontinued.

This is not a problem on cocoa port.