Bug 564406 - [JFace] ComboViewer/Combo setBackground is not taken into account
Summary: [JFace] ComboViewer/Combo setBackground is not taken into account
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-18 05:17 EDT by Axel RICHARD CLA
Modified: 2022-02-18 03:32 EST (History)
2 users (show)

See Also:


Attachments
564406-TestProject (6.71 KB, application/zip)
2020-06-18 10:28 EDT, Axel RICHARD CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.