Bug 564406

Summary: [JFace] ComboViewer/Combo setBackground is not taken into account
Product: [Eclipse Project] Platform Reporter: Axel RICHARD <axel.richard>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: hubert+eclipseorg, lshanmug
Version: 4.17   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
564406-TestProject none

Description Axel RICHARD CLA 2020-06-18 05:17:10 EDT
Hello,

With the following code:

ComboViewer comboViewer = new ComboViewer(parentComposite, SWT.READ_ONLY);
Combo combo = comboViewer.getCombo();
combo.setBackground(new Color(parentComposite.getDisplay(), 0, 255, 0));

The background color of the Combo is not taken into account.

The SWT.READ_ONLY state doesn't change anything.
Also note that 
combo.setForeground(new Color(parentComposite.getDisplay(), 0, 255, 0)); 
is working.

Is there a solution to that problem ? (another than using a CCombo)
Could it be fixed ?

Best regards,
Comment 1 Alexander Kurtakov CLA 2020-06-18 05:47:41 EDT
Can you attach a snippet to reproduce and screenshot? Also please share the gtk version and theme used. One issue with combo background has already been fixed in 4.17 stream via bug 489035.
Comment 2 Axel RICHARD CLA 2020-06-18 10:28:49 EDT
Created attachment 283343 [details]
564406-TestProject

An eclipse plug-in test project to reproduce the issue.

Just import it in Eclipse, launch an Eclipse Application Configuration.
Then select, the "ComboViewer Test Menu > ComboViewer Test Command". A dialog will appear with a ComboViewer showing the problem.

Thanks
Comment 3 Axel RICHARD CLA 2020-06-18 10:31:57 EDT
- Theme used: classic one
- GTK: no GTK, macOS user here
Comment 4 Alexander Kurtakov CLA 2020-06-18 10:42:40 EDT
Setting the OS to MacOS.
Comment 5 Lakshmi P Shanmugam CLA 2020-06-23 08:47:38 EDT
This is a current limitation of Combo on Mac, NSComboBox and NSPopUpButton don't provide direct methods to set the background color.