- // GTK 1.2.0 doesn't have gtk_item_factory_get_item(), but GTK 1.2.1 has.
-#if GTK_CHECK_VERSION(1, 2, 1)
-
- wxString buf;
- buf << wxT('/') << str.c_str();
-
- // local buffer in multibyte form
- char cbuf[400];
- strcpy(cbuf, wxGTK_CONV(buf) );
-
- GtkItemFactoryEntry entry;
- entry.path = (gchar *)cbuf; // const_cast
- entry.accelerator = (gchar*) NULL;
- entry.callback = (GtkItemFactoryCallback) NULL;
- entry.callback_action = 0;
- entry.item_type = (char *)"<Branch>";
-
- gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); // what is 2 ?
- // in order to get the pointer to the item we need the item text _without_ underscores
- wxString tmp = wxT("<main>/");
- const wxChar *pc;
- for ( pc = str; *pc != wxT('\0'); pc++ )
+ // The "m_owner" is the "menu item"
+#ifdef __WXGTK20__
+ menu->m_owner = gtk_menu_item_new_with_mnemonic( wxGTK_CONV( str ) );
+#else
+ menu->m_owner = gtk_menu_item_new_with_label( wxGTK_CONV( str ) );
+ GtkLabel *label = GTK_LABEL( GTK_BIN(menu->m_owner)->child );
+ // set new text
+ gtk_label_set_text( label, wxGTK_CONV( str ) );
+ // reparse key accel
+ guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( str ) );
+ if (accel_key != GDK_VoidSymbol)