- GtkLabel *label;
- if (m_labelWidget)
- label = (GtkLabel*) m_labelWidget;
- else
- label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
-
- // stock menu items can have empty labels:
- wxString text = m_text;
- if (text.IsEmpty() && !IsSeparator())
- {
- wxASSERT_MSG(isstock, wxT("A non-stock menu item with an empty label?"));
- text = wxGetStockLabel(GetId());
-
- // need & => _ conversion
- text = GTKProcessMenuItemLabel(text, NULL);
- }
-
- gtk_label_set_text_with_mnemonic( GTK_LABEL(label), wxGTK_CONV_SYS(text) );
- }
-
- // remove old accelerator from our parent's accelerator group, if present
- guint accel_key;
- GdkModifierType accel_mods;
- if (oldbuf[(size_t)0] != '\0')
- {
- gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods);
- if (accel_key != 0)
- {
- gtk_widget_remove_accelerator(m_menuItem,
- m_parentMenu->m_accel,
- accel_key,
- accel_mods );
- }
- }
- else if (isstock)
- {
- // if the accelerator was taken from a stock ID, just get it back from GTK+ stock
- if (wxGetStockGtkAccelerator(stockid, &accel_mods, &accel_key))
- gtk_widget_remove_accelerator( m_menuItem,
- m_parentMenu->m_accel,
- accel_key,
- accel_mods );
- }
-
- // add new accelerator to our parent's accelerator group
- wxCharBuffer buf = wxGTK_CONV_SYS( GetGtkHotKey(*this) );
- if (buf[(size_t)0] != '\0')
- {
- gtk_accelerator_parse( (const char*) buf, &accel_key, &accel_mods);
- if (accel_key != 0)