diff options
6 files changed, 37 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index b90a6f81ff..0a0a201990 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -9392,6 +9392,24 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1combo_1box_1text_1new_1with_1entry) } #endif +#ifndef NO__1gtk_1combo_1box_1text_1remove_1all +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1combo_1box_1text_1remove_1all) + (JNIEnv *env, jclass that, jintLong arg0) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1combo_1box_1text_1remove_1all_FUNC); +/* + gtk_combo_box_text_remove_all(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_combo_box_text_remove_all) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1combo_1box_1text_1remove_1all_FUNC); +} +#endif + #ifndef NO__1gtk_1container_1add JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1container_1add) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h index f9c5b304d1..27edf6cd35 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h @@ -126,6 +126,7 @@ #define gtk_combo_box_text_insert_LIB LIB_GTK #define gtk_combo_box_insert_text_LIB LIB_GTK #define gtk_combo_box_remove_text_LIB LIB_GTK +#define gtk_combo_box_text_remove_all_LIB LIB_GTK #define gtk_combo_box_get_active_LIB LIB_GTK #define gtk_combo_box_get_model_LIB LIB_GTK #define gtk_combo_box_set_active_LIB LIB_GTK diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 6bb6a23423..55c083309d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -692,6 +692,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1combo_1box_1text_1insert", "_1gtk_1combo_1box_1text_1new", "_1gtk_1combo_1box_1text_1new_1with_1entry", + "_1gtk_1combo_1box_1text_1remove_1all", "_1gtk_1container_1add", "_1gtk_1container_1forall", "_1gtk_1container_1get_1border_1width", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index ef84a68ddc..4ce23cf058 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -702,6 +702,7 @@ typedef enum { _1gtk_1combo_1box_1text_1insert_FUNC, _1gtk_1combo_1box_1text_1new_FUNC, _1gtk_1combo_1box_1text_1new_1with_1entry_FUNC, + _1gtk_1combo_1box_1text_1remove_1all_FUNC, _1gtk_1container_1add_FUNC, _1gtk_1container_1forall_FUNC, _1gtk_1container_1get_1border_1width_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index c685a447d4..68b288c4db 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -6694,6 +6694,16 @@ public static final void gtk_combo_box_remove_text(long /*int*/ combo_box, int p } } /** @method flags=dynamic */ +public static final native void _gtk_combo_box_text_remove_all(long /*int*/ combo_box); +public static final void gtk_combo_box_text_remove_all(long /*int*/ combo_box) { + lock.lock(); + try { + _gtk_combo_box_text_remove_all(combo_box); + } finally { + lock.unlock(); + } +} +/** @method flags=dynamic */ public static final native int _gtk_combo_box_get_active(long /*int*/ combo_box); public static final int gtk_combo_box_get_active(long /*int*/ combo_box) { lock.lock(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java index 72e24c5d07..37911f44b5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java @@ -1858,8 +1858,12 @@ public void setItems (String [] items) { this.items = new String [items.length]; System.arraycopy (items, 0, this.items, 0, items.length); clearText (); - for (int i = count - 1; i >= 0; i--) { - OS.gtk_combo_box_remove_text (handle, i); + if (OS.GTK3) { + OS.gtk_combo_box_text_remove_all(handle); + } else { + 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]; |