lockText = ignoreSelect = true; OS.gtk_list_clear_items (listHandle, 0, -1); int  font = getFontDescription (); GdkColor color = getForegroundColor (); int direction = OS.gtk_widget_get_direction (handle); int i = 0; while (i < items.length) { String string = items [i]; byte [] buffer = Converter.wcsToMbcs (null, string, true); int  item = OS.gtk_list_item_new_with_label (buffer); int  label = OS.gtk_bin_get_child (item); OS.gtk_widget_modify_fg (label, OS.GTK_STATE_NORMAL, color); OS.gtk_widget_modify_font (label, font); OS.gtk_widget_set_direction (label, direction); OS.gtk_container_add (listHandle, item); OS.gtk_widget_show (item); i++;
int count = this.items.length; this.items = new String [items.length]; System.arraycopy (items, 0, this.items, 0, items.length); if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) { clearText (); for (int i = count - 1; i >= 0; i--) { OS.gtk_combo_box_remove_text (handle, i); } for (int i = 0; i < items.length; i++) { String string = items [i]; byte [] buffer = Converter.wcsToMbcs (null, string, true); OS.gtk_combo_box_insert_text (handle, i, buffer); } } else { lockText = ignoreSelect = true; OS.gtk_list_clear_items (listHandle, 0, -1); int  font = getFontDescription (); GdkColor color = getForegroundColor (); int direction = OS.gtk_widget_get_direction (handle); int i = 0; while (i < items.length) { String string = items [i]; byte [] buffer = Converter.wcsToMbcs (null, string, true); int  item = OS.gtk_list_item_new_with_label (buffer); int  label = OS.gtk_bin_get_child (item); OS.gtk_widget_modify_fg (label, OS.GTK_STATE_NORMAL, color); OS.gtk_widget_modify_font (label, font); OS.gtk_widget_set_direction (label, direction); OS.gtk_container_add (listHandle, item); OS.gtk_widget_show (item); i++; } lockText = ignoreSelect = false; OS.gtk_entry_set_text (entryHandle, new byte[1]);
public void setItems (String [] items) {	checkWidget();	if (items == null) error (SWT.ERROR_NULL_ARGUMENT);	for (int i=0; i<items.length; i++) {		if (items [i] == null) error (SWT.ERROR_INVALID_ARGUMENT);	}	lockText = ignoreSelect = true;	OS.gtk_list_clear_items (listHandle, 0, -1);	int /*long*/ font = getFontDescription ();	GdkColor color = getForegroundColor ();	int direction = OS.gtk_widget_get_direction (handle);	int i = 0;	while (i < items.length) {		String string = items [i];		byte [] buffer = Converter.wcsToMbcs (null, string, true);		int /*long*/ item = OS.gtk_list_item_new_with_label (buffer);		int /*long*/ label = OS.gtk_bin_get_child (item); 		OS.gtk_widget_modify_fg (label, OS.GTK_STATE_NORMAL, color);		OS.gtk_widget_modify_font (label, font);		OS.gtk_widget_set_direction (label, direction);		OS.gtk_container_add (listHandle, item);		OS.gtk_widget_show (item);		i++;	}	this.items = new String [items.length];	System.arraycopy (items, 0, this.items, 0, i);	lockText = ignoreSelect = false;	OS.gtk_entry_set_text (entryHandle, new byte[1]);}