if (!ignoreSelect) { int  ptr = OS.gtk_entry_get_text (entryHandle); int length = OS.strlen (ptr); byte [] buffer = new byte [length]; OS.memmove (buffer, ptr, length); String text = new String (Converter.mbcsToWcs (null, buffer)); for (int i = 0; i < items.length; i++) { if (items [i].equals (text)) { postEvent (SWT.Selection); break;
if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { if (widget == handle) { postEvent (SWT.Selection); return 0; } } else { if (!ignoreSelect) { int  ptr = OS.gtk_entry_get_text (entryHandle); int length = OS.strlen (ptr); byte [] buffer = new byte [length]; OS.memmove (buffer, ptr, length); String text = new String (Converter.mbcsToWcs (null, buffer)); for (int i = 0; i < items.length; i++) { if (items [i].equals (text)) { postEvent (SWT.Selection); break; }
int /*long*/ gtk_changed (int /*long*/ widget) {	if (!ignoreSelect) {		int /*long*/ ptr = OS.gtk_entry_get_text (entryHandle);		int length = OS.strlen (ptr);		byte [] buffer = new byte [length];		OS.memmove (buffer, ptr, length);		String text = new String (Converter.mbcsToWcs (null, buffer));		for (int i = 0; i < items.length; i++) {			if (items [i].equals (text)) {				postEvent (SWT.Selection);				break;			}		}	}	/*	* Feature in GTK.  When the user types, GTK positions	* the caret after sending the changed signal.  This	* means that application code that attempts to position	* the caret during a changed signal will fail.  The fix	* is to post the modify event when the user is typing.	*/	boolean keyPress = false;	int /*long*/ eventPtr = OS.gtk_get_current_event ();	if (eventPtr != 0) {		GdkEventKey gdkEvent = new GdkEventKey ();		OS.memmove (gdkEvent, eventPtr, GdkEventKey.sizeof);		switch (gdkEvent.type) {			case OS.GDK_KEY_PRESS:				keyPress = true;				break;		}		OS.gdk_event_free (eventPtr);	}	if (keyPress) {		postEvent (SWT.Modify);	} else {		sendEvent (SWT.Modify);	}	return 0;}