+void wxMenuItem::DestroyItem(bool full)
+{
+ if (GetId() == -2)
+ {
+ ; // Nothing
+
+ }
+ else if ((!m_strName.IsNull() && (m_strName != "")) && !m_pSubMenu)
+ {
+ if (m_buttonWidget)
+ {
+ if (IsCheckable())
+ XtRemoveCallback ((Widget) m_buttonWidget, XmNvalueChangedCallback,
+ wxMenuItemCallback, (XtPointer) this);
+ else
+ XtRemoveCallback ((Widget) m_buttonWidget, XmNactivateCallback,
+ wxMenuItemCallback, (XtPointer) this);
+ XtRemoveCallback ((Widget) m_buttonWidget, XmNarmCallback,
+ wxMenuItemArmCallback, (XtPointer) this);
+ XtRemoveCallback ((Widget) m_buttonWidget, XmNdisarmCallback,
+ wxMenuItemDisarmCallback, (XtPointer) this);
+ }
+ }
+ else if (GetId() == -1)
+ {
+ ; // Nothing
+
+ }
+ else if (GetSubMenu())
+ {
+ if (m_buttonWidget)
+ {
+ XtRemoveCallback ((Widget) m_buttonWidget, XmNcascadingCallback,
+ wxMenuItemArmCallback, (XtPointer) this);
+ }
+ m_pSubMenu->DestroyMenu(full);
+ if (full)
+ m_buttonWidget = NULL;
+ }
+
+ if (m_buttonWidget && full)
+ {
+ XtDestroyWidget ((Widget) m_buttonWidget);
+ m_buttonWidget = (WXWidget) 0;
+ }
+}
+
+void wxMenuItem::SetLabel(const wxString& label)
+{
+ char mnem = wxFindMnemonic (label);
+ wxString label2 = wxStripMenuCodes(label);
+
+ m_strName = label;
+
+ if (m_buttonWidget)
+ {
+ wxXmString label_str(label2);
+ XtVaSetValues ((Widget) m_buttonWidget,
+ XmNlabelString, label_str,
+ NULL);
+ if (mnem != 0)
+ XtVaSetValues ((Widget) m_buttonWidget, XmNmnemonic, mnem, NULL);
+ char *accel = wxFindAccelerator (label2);
+ if (accel)
+ XtVaSetValues ((Widget) m_buttonWidget, XmNaccelerator, accel, NULL);
+
+ XmString accel_str = wxFindAcceleratorText (label2);
+ if (accel_str)
+ {
+ XtVaSetValues ((Widget) m_buttonWidget, XmNacceleratorText, accel_str, NULL);
+ XmStringFree (accel_str);
+ }
+ }
+}
+
+void wxMenuItemCallback (Widget w, XtPointer clientData,
+ XtPointer ptr)