-int wxComboBox::FindString( const wxString &item )
-{
- GtkWidget *list = GTK_COMBO(m_widget)->list;
-
- GList *child = GTK_LIST(list)->children;
- int count = 0;
- while (child)
- {
- GtkBin *bin = GTK_BIN( child->data );
- GtkLabel *label = GTK_LABEL( bin->child );
- if (item == label->label) return count;
- count++;
- child = child->next;
- }
-
- wxFAIL_MSG( "wxComboBox: string not found" );
-
- return -1;
+ m_widget = gtk_combo_box_entry_new_text();
+
+ // Set it up to trigger default item on enter key press
+ GtkWidget *widget = gtk_bin_get_child(GTK_BIN(m_widget));
+ gtk_entry_set_activates_default(GTK_ENTRY(widget),
+ !HasFlag(wxTE_PROCESS_ENTER));
+
+ if (HasFlag(wxBORDER_NONE))
+ {
+ // Doesn't seem to work
+ // g_object_set (m_widget, "has-frame", FALSE, NULL);
+ }
+
+ GtkEntry * const entry = GetEntry();
+
+ gtk_entry_set_editable( entry, TRUE );
+
+ Append(n, choices);
+
+ m_parent->DoAddChild( this );
+
+ m_focusWidget = GTK_WIDGET( entry );
+
+ PostCreation(size);
+
+ gtk_entry_set_text( entry, wxGTK_CONV(value) );
+
+ if (style & wxCB_READONLY)
+ gtk_entry_set_editable( entry, FALSE );
+
+ g_signal_connect_after (entry, "changed",
+ G_CALLBACK (gtkcombobox_text_changed_callback), this);
+
+ g_signal_connect_after (m_widget, "changed",
+ G_CALLBACK (gtkcombobox_changed_callback), this);
+
+ SetInitialSize(size); // need this too because this is a wxControlWithItems
+
+ return true;