Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 285316 Details for
Bug 570489
[GTK] Combo's selection background is broken after Combo.setBackground()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Test snippet
Bug570489_Gtk_ComboSetBackground.java (text/plain), 1.91 KB, created by
Alexandr Miloslavskiy
on 2021-01-19 14:10:51 EST
(
hide
)
Description:
Test snippet
Filename:
MIME Type:
Creator:
Alexandr Miloslavskiy
Created:
2021-01-19 14:10:51 EST
Size:
1.91 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2021 Syntevo and others. > * > * This program and the accompanying materials > * are made available under the terms of the Eclipse Public License 2.0 > * which accompanies this distribution, and is available at > * https://www.eclipse.org/legal/epl-2.0/ > * > * SPDX-License-Identifier: EPL-2.0 > * > * Contributors: > * Syntevo - initial API and implementation > *******************************************************************************/ >package org.eclipse.swt.tests.manual; > >import org.eclipse.swt.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.layout.*; >import org.eclipse.swt.widgets.*; > >public class Bug570489_Gtk_ComboSetBackground { > public static void main(String[] args) { > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new GridLayout(1, true)); > > final Text hint = new Text(shell, SWT.READ_ONLY | SWT.MULTI); > hint.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > hint.setText( > "1) Run this snippet on GTK\n" + > "2) Check & uncheck checkbox below\n" + > "3) Notice that combo's selection background is no longer visible" > ); > > final Combo combo = new Combo(shell, 0); > combo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > combo.setText("Test combo text"); > combo.setSelection(new Point(5, 10)); > > Button button = new Button(shell, SWT.CHECK); > button.setText("Set custom background color"); > button.addListener(SWT.Selection, e -> { > final boolean isSelected = ((Button)e.widget).getSelection(); > if (isSelected) { > combo.setData(combo.getBackground()); > combo.setBackground(display.getSystemColor(SWT.COLOR_RED)); > } else { > combo.setBackground((Color)combo.getData()); > } > }); > > shell.pack(); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) > display.sleep(); > } > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 570489
:
285316
|
285317