Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Gtk Error message when creating ExpandItems dynamically on linux(Gtk-CRITICAL **: IA__gtk_widget_map: assertion `gtk_widget_get_visible (widget)' failed)
Gtk Error message when creating ExpandItems dynamically on linux [message #1321844] Tue, 29 April 2014 14:40
Daniel Galdames is currently offline Daniel GaldamesFriend
Messages: 2
Registered: March 2011
Junior Member
To reproduce run the code below and select the menu "File->New ExpandItem". A gtk error message as above is displayed on the terminal/console.

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.ExpandBar;
import org.eclipse.swt.widgets.ExpandItem;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;

public class ExpandBarExample {
	private static int counter;
	private static ExpandBar expandBar;

	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		shell.setText("Expand bar example");
		expandBar = new ExpandBar(shell, SWT.V_SCROLL);
		for (counter=0; counter < 3;counter++) {
			createExpandItem(expandBar, "item " + String.valueOf(counter));
	    while (!shell.isDisposed())
	        if (!display.readAndDispatch())
	private static void createMenuBar(Shell shell) {
		Menu menubar = new Menu(shell, SWT.BAR);
		MenuItem fileItem = new MenuItem(menubar, SWT.CASCADE);
		Menu submenu = new Menu(shell, SWT.DROP_DOWN);
		MenuItem item = new MenuItem(submenu, SWT.PUSH);
		item.setText("New ExpandItem");
		item.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event event) {
				createExpandItem(expandBar, "item " + String.valueOf(counter++));				

	private static void createExpandItem(ExpandBar bar, String text) {
		ExpandItem item = new ExpandItem(bar, SWT.NONE);

Previous Topic:Aligning TextLayout to the text baseline
Next Topic:Backport Firefox 24 integration to 3.X
Goto Forum:

Current Time: Wed May 23 22:53:13 GMT 2018

Powered by FUDForum. Page generated in 0.01862 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top