+ wxCHECK_RET( m_widget != NULL, wxT("invalid choice") );
+
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
+ unsigned int count = 0;
+ GList *child = menu_shell->children;
+ while (child)
+ {
+ GtkBin *bin = GTK_BIN( child->data );
+ if (count == n)
+ {
+ 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") );
+
+ gtk_label_set_text( label, wxGTK_CONV( str ) );
+
+ InvalidateBestSize();
+
+ return;
+ }
+ child = child->next;
+ count++;
+ }
+}
+
+wxString wxChoice::GetString(unsigned int n) const
+{
+ wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid choice") );
+
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
+ unsigned int count = 0;
+ GList *child = menu_shell->children;
+ while (child)
+ {
+ GtkBin *bin = GTK_BIN( child->data );
+ if (count == n)
+ {
+ 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") );
+
+ return wxString( wxGTK_CONV_BACK( gtk_label_get_text( label) ) );
+ }
+ child = child->next;
+ count++;
+ }
+
+ wxFAIL_MSG( wxT("wxChoice: invalid index in GetString()") );
+
+ return wxEmptyString;
+}
+
+unsigned int wxChoice::GetCount() const
+{
+ wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid choice") );
+
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
+ unsigned int count = 0;
+ GList *child = menu_shell->children;
+ while (child)
+ {
+ count++;
+ child = child->next;
+ }
+ return count;