- const size_t count = GetCount();
-
- if ( m_clientDataList.GetCount() < count )
- m_clientDataList.Append( (wxObject*) NULL );
- if ( m_clientObjectList.GetCount() < count )
- m_clientObjectList.Append( (wxObject*) NULL );
-
- InvalidateBestSize();
-
- return count - 1;
-}
-
-int wxComboBox::DoInsert( const wxString &item, int pos )
-{
- wxCHECK_MSG( !(GetWindowStyle() & wxCB_SORT), -1,
- wxT("can't insert into sorted list"));
-
- wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid combobox") );
- wxCHECK_MSG( IsValidInsert(pos), -1, wxT("invalid index") );
-
- const size_t count = GetCount();
-
- if ((size_t)pos == count)
- return Append(item);
-
-#ifdef __WXGTK24__
- if (!gtk_check_version(2,4,0))
- {
- GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
- gtk_combo_box_insert_text( combobox, pos, wxGTK_CONV( item ) );
- }
- else
-#endif
- {
- DisableEvents();
-
- GtkWidget *list = GTK_COMBO(m_widget)->list;
- GtkWidget *list_item = gtk_list_item_new_with_label( wxGTK_CONV( item ) );
-
- GList *gitem_list = g_list_alloc ();
- gitem_list->data = list_item;
- gtk_list_insert_items( GTK_LIST (list), gitem_list, pos );