final boolean[] mapped = new boolean [1]; Callback proc = new Callback(new Object() { public int proc(int widget, int event, int userdata) { mapped [0] = true; return 0; } }, "proc", 3); int id = OS.g_signal_connect (shellHandle, OS.map_event, proc.getAddress (), 0); while (!isDisposed () && !mapped [0]) {
while (!isDisposed () && !mapped) {
public void setVisible (boolean visible) {	checkWidget();	if (visible) {		/*		* Bug in GTK.  When an application opens a new modal top level		* shell from inside the "select_row" signal, the GtkCList does not get the		* mouse up and does not release grabs.  The fix is to release the grabs		* when any shell is opened.		*/		int grabHandle = OS.gtk_grab_get_current ();		if (grabHandle != 0) {			OS.gtk_grab_remove (grabHandle);			OS.gdk_pointer_ungrab (OS.GDK_CURRENT_TIME);		}		sendEvent (SWT.Show);		// widget could be disposed at this point		if (isDisposed ()) return;		OS.gtk_widget_show (shellHandle);				//TEMPORARY CODE		final boolean[] mapped = new boolean [1];		Callback proc = new Callback(new Object() {			public int proc(int widget, int event, int userdata) {				mapped [0] = true;				return 0;			}		}, "proc", 3);		int id = OS.g_signal_connect (shellHandle, OS.map_event, proc.getAddress (), 0);				while (!isDisposed () && !mapped [0]) {			OS.gtk_main_iteration ();		}		proc.dispose();		// widget could be disposed at this point		if (isDisposed ()) return;		OS.g_signal_handler_disconnect (shellHandle, id);				adjustTrim ();	} else {			OS.gtk_widget_hide (shellHandle);		sendEvent (SWT.Hide);	}}