Skip to content

Issues when running Eclipse on GTK3 #375

Answered by wimjongman
wimjongman asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, I found it. It turns out that system colors can be disposed in gtk but not in win.

The following snippet runs on windows but not on ubuntu:

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Snippet {

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(1, false));
		Color systemColor = display.getSystemColor(SWT.COLOR_WHITE);
		shell.setBackground(systemColor);
		systemColor.dispose();
		systemColor = display.getSystemColor(SWT.COLOR_WHITE);
		…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@wimjongman
Comment options

wimjongman Sep 7, 2022
Collaborator Author

Comment options

wimjongman
Sep 7, 2022
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by wimjongman
Comment options

You must be logged in to vote
1 reply
@wimjongman
Comment options

wimjongman Sep 7, 2022
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants