- m_clientDataList.Append( (wxObject*) NULL );
- m_clientObjectList.Append( (wxObject*) clientData );
+ wxCHECK_MSG( !(GetWindowStyle() & wxCB_SORT), -1,
+ wxT("can't insert into sorted list"));
+
+ wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid combobox") );
+
+ int count = GetCount();
+ wxCHECK_MSG( (pos >= 0) && (pos <= count), -1, wxT("invalid index") );
+
+ if (pos == count)
+ return Append(item);
+
+ 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 );
+
+ if (GTK_WIDGET_REALIZED(m_widget))
+ {
+ gtk_widget_realize( list_item );
+ gtk_widget_realize( GTK_BIN(list_item)->child );
+
+ ApplyWidgetStyle();
+ }