+ int selection = wxNOT_FOUND;
+
+#ifdef __WXGTK20__
+ selection = gtk_option_menu_get_history( GTK_OPTION_MENU(choice->GetHandle()) );
+#else
+ GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(choice->GetHandle()) ) );
+ int count = 0;
+
+ GList *child = menu_shell->children;
+ while (child)
+ {
+ GtkBin *bin = GTK_BIN( child->data );
+ if (!bin->child)
+ {
+ selection = count;
+ break;
+ }
+ child = child->next;
+ count++;
+ }
+#endif
+ choice->m_selection_hack = selection;
+