+ // invalidate the selection
+ m_selection_hack = wxNOT_FOUND;
+ }
+
+ // VZ: apparently GTK+ doesn't have a built-in function to do it (not even
+ // in 2.0), hence this dumb implementation -- still better than nothing
+ const unsigned int count = GetCount();
+
+ wxArrayString items;
+ wxArrayPtrVoid itemsData;
+ items.Alloc(count - 1);
+ itemsData.Alloc(count - 1);
+ for ( unsigned i = 0; i < count; i++ )
+ {
+ if ( i != n )
+ {
+ items.Add(GetString(i));
+ itemsData.Add(m_clientData[i]);
+ }
+ }
+
+ wxChoice::DoClear();
+
+ if ( count > 1 )
+ {
+ void ** const data = &itemsData[0];
+ if ( HasClientObjectData() )
+ Append(items, wx_reinterpret_cast(wxClientData **, data));
+ else
+ Append(items, data);
+ }
+ //else: the control is now empty, nothing to append
+}
+
+int wxChoice::FindString( const wxString &string, bool bCase ) const
+{
+ wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid choice") );
+
+ // If you read this code once and you think you understand
+ // it, then you are very wrong. Robert Roebling.
+
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
+ int count = 0;
+ GList *child = menu_shell->children;
+ while (child)
+ {
+ GtkBin *bin = GTK_BIN( child->data );
+ GtkLabel *label = (GtkLabel *) NULL;
+ if (bin->child)
+ label = GTK_LABEL(bin->child);
+ if (!label)
+ label = GTK_LABEL(GTK_BIN(m_widget)->child);
+
+ wxASSERT_MSG( label != NULL , wxT("wxChoice: invalid label") );
+
+ wxString tmp( wxGTK_CONV_BACK( gtk_label_get_text( label) ) );
+ if (string.IsSameAs( tmp, bCase ))
+ return count;
+
+ child = child->next;
+ count++;